Category: Uncategorized

>Linux Secrets!

>1. Linux uses COW scheme with virtual memory management.2. Threads in Linux can be LinuxThreads, NPTL(Redhat). NPTL is more efficient and from kernel 2.6 onwards it’ll be used. Using env variable LD_ASSUME_KERNEL you can decide which thread library to choose.3. Linux kernel do not discriminate between threads and processes while making scheduling decision.4. Memory allocation of a process can be…

>Linux Memory Management Secrets!

>Tips to Improve Dynamic Memory Performance – Instead of using memset() to initialize malloc()’ed memory, use calloc(). Because when you call memset(), VM system has to map the pages in to memory in order to zero initialize them. It’s very expensive and wasteful if you don’t intend to use the pages right away.calloc() reserves the needed address space but does…