Quote:
Originally Posted by anoopbt
i am using a solaris system. when i did "pmap pid" (pid = my process id) it is showing a number of heap memory allocated and all of them with GB sizes. This single process is eating up most of the physical memory.
|
Are you sure it is eating that much physical memory?
It is common for heap mappings in a process to be mostly "demand zero". That means the process has requested that address space for heap, but hasn't used it. Until the process actually uses each page, that page has no physical existence in either ram or swap.
I have no knowledge regarding your perl program. So I won't guess at its normal heap use.
Quote:
and is there any way to get the heap memory size down? .
|
I'm not sure about Solaris, but I think it has something similar to ulimit that could be set to prevent the process from taking too much heap. In most cases, preventing a process from taking the heap that it wants would crash the process rather than make the process function with less heap.
There might be some configuration for Perl that makes it pre allocate heap less aggressively, so if the heap is mostly demand zero, there might be a way to reduce that.
But in both the above half baked ideas, it could only be possible to reduce heap size if it is pointless to reduce heap size. If the heap is mainly demand zero, there is no reason to shrink it. The part of the heap that isn't demand zero could only be restricted by forcing the process to fail.