Question

I have an apache module that is load a file of 100MB into memory when it was requested.

So to reduce execution time, i tried IPC shared memory(the parent process create shm segment, then children attach it.)

I am currently using APR apr_shm_create(mmap + shmopen) for this.

But I found also RSS(ps aux | grep httpd) of every child processes have approximately 100MB, respectively, when it was executed. (except the moment when attached.)

Question: How can I reset or prevent RSS increase of child processes, thus memory consumed just only 100MB size in whole httpd processes? Is this impossible?

Was it helpful?

Solution

The resident set size of a process is the total size of memory pages mapped into that process' memory and which reside in RAM. When a process attaches to a shared memory whose size is 100 MB, its RSS will increase by 100 MB (if the shared memory segment resides in RAM and is not swapped or not yet physically allocated). But this doesn't mean that more physical RAM was occupied.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top