0

I have a java process using jetty websockets. The process shows 151 live threads. The top result is showing 797MB of Resident memory.

enter image description here

Heap Memory used shows Committed as 231 MB

enter image description here

Non Heap Memory shows 115 MB.

enter image description here

There are total 1100 open file descriptors.

enter image description here

What I understand is every thread has a thread stack, say it is 1MB, then total memory used should be 151M + 231M + 115M + (file descriptors memory). Can someone tell me how all these lead to 797 MB of resident memory? What am I missing or not counting?

Abhishek Kumar
  • 3,328
  • 2
  • 18
  • 31
  • What are the resources managed by threads? Your count is 500Mb, your measure is 800Mb, difference is 300Mb, then 2Mb/thread or 280Kb/opened file. Well this is not surprising... There is a lot of small resources that you are not counting... You can use the flight recorder to examine precisely what happens. – Jean-Baptiste Yunès Mar 16 '18 at 08:19
  • They are normal jetty threads, processor threads doing small tasks. The files are the open websocket connections. I will check about flight recorder. What are the other small resources you meant, any reference/doc? – Abhishek Kumar Mar 16 '18 at 10:42
  • Your threads are executing code, then they necessarily use some data. Without code, impossible to answer. Use FR and you will see everything. What I mean is that what you think as too big is certainly not. Counting so roughly is not possible and having 30% error in your approximation is then normal. – Jean-Baptiste Yunès Mar 16 '18 at 10:43
  • Possible duplicate of [Huge system memory usage of java applications compared to heap usage](https://stackoverflow.com/questions/38223821/huge-system-memory-usage-of-java-applications-compared-to-heap-usage) – the8472 Mar 17 '18 at 15:27

0 Answers0