Sunday, May 24, 2015

linux - Identifying lost physical memory

I am having issues with a server running out of physical memory and I'm having troubles discerning whether it is from my application's Java process or something else on the server. Let's take the following scenario:



Server physical memory: 3747MB
Java -Xms64m
Java -Xmx512m
Java XX:MaxPermSize=512m



When I boot up the server, the OS (RHEL) reports that 487MB are being used, using your favorite memory reporting tool (top, cat /proc/meminfo | grep Mem, free -m, etc). When I start my Java process (pid 123), it uses around 215MB of physical memory (as reported by RES memory in ps -f -p 123), taking my total used memory up to around 700MB.



If I let it run for an entire day, the RES memory for my process fluctuates a little, but is generally consistent. However the total server memory has steadily increased around 1500MB, taking it to a total of 2200MB.



If my java heap size or perm gen heap were growing, wouldn't it be reflected in the process' RES memory?




Also, I can't seem to account for that extra 1500MB anywhere.



# ps aux | awk '{ RES+=$6 } END { printf("RES: %.2fMB\n", RES/1024) }'
RES: 722.23MB


Can anyone help me find that lost memory? I am basically trying to figure out if this is my problem with the application, or the infrastructure team's problem with their server build.

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...