I am facing an issue with memory management in AIX 5.3. My Process crashes with malloc/calloc failure. But it is allocating and freeing all the memory when required. I have run svmon command for several times and found that pgsp value is growing continuosly. here is the output for two times taken after six hours:
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
0 0 work kernel segment s 9578 9232 3941 13455
7709d d work shared library text s 3857 0 130 10935
11490 2 work process private s 3526 3 23468 26942
49ce6 - clnt /dev/ptv3:950 s 151 0 - -
215ac 1 clnt code,/dev/ptv3:654 s 143 0 - -
4483b f work shared library data s 32 0 14 41
2d56f - clnt /dev/ptv3:667 s 1 0 - -
Vsid Esid Type Description PSize Inuse Pin Pgsp Virtual
0 0 work kernel segment s 9501 9232 3999 13443
7709d d work shared library text s 2890 0 131 10935
11490 2 work process private s 315 3 27918 28175
25d1d - clnt /dev/ptv3:956 s 276 0 - -
215ac 1 clnt code,/dev/ptv3:654 s 161 0 - -
4483b f work shared library data s 32 0 14 41
2d56f - clnt /dev/ptv3reg1lv:77667 s 1 0 - -
here pgsp and virtual memory values are increasing. My questions are:
1) Does it concludes to a memory leak?
2) If yes, then how can it be solved?
you have an issue with real memory ... you are using 60% more computational than you have physically in the system - so obviously your system is paging a lot - and you do allow your system even to page computational memory - this slows down your system and is causing your memory warnings. If you don't rapidly add memory, your system will crash once the pagingspace is full - and this won't take too long ...
You have physically 1 GB in your box ...
you are using for computational reasons 406397 x 4k pages = 1.6 GB and you are allowing the paging of computational pages: lru_file_repage = 1 so your system is doing exactly what it is supposed to do - whenever a new process is forked, the amount of pagingspace in use will grow - and the AIX kernel will use more memory over time since he is growing continuously - even when that is not much.
Recommendation is to add memory until your avm value is around 70% of your physical memory (so about 1.5 GB memory).
As a rule of thumb - AIX and background processes like you have them hopefully on your box (nmon, monitoring, whatever) are eating up usually between 500 and 1500 MB memory - everything above this is memory for the applications - in your case there is nothing above ...
Just for my curiosity - are you running websphere or mq on this box ?
Thanks again for your instant reply to my problem. As per your note my system is certainly running out of memory and I need to add more memory to it. Could you please help me to know that why does it crashes only this process "pemnl" and not any other. I do not see the paging space growing for any other process. And all other processes doesnot crash but only this one crashes in gap of 2-3 days.
Sebby,
when you are that much out of memory, and the paging space is running dangerously low, the system will kill automatically processes that consume memory - depending on the amount of memory missing it seems to try to kill the processes using the most memory (at least I assume that is the reason why its always the same process on your box - not too sure in this point) ... low_ps_handling = 1 is allowing the system to do so. If this value would not have been set, your system would have already crashed/rebooted itself to free up the paging area.