I have a server java app use jetty websocket server and bittorrent-tracker for websocket client
The issue is when I run with many client it has a memory leak in my java app
I check the memory usage of java app by "htop" and "jcmd PID VM.native_memory"
- The RES in "htop" show 6.4G
- The memory committed in "jcmd" show 2G
The jetty websocket version I use is jetty-9.4.15.v20190215, I had try newer version jetty-9.4.44.v20210927 but still memory leak
I had tested with client build from jetty websocket-client and memory leak doesn't happen
I also test with following options
- Only use lib jetty websocket on my server java app
- When handle onMessage I just receive messages and not take any process or response
=> Basically the server only receives connect from client and memory leak still happen.
The question is
- Where cause memory leak ?
- Why physical memory(RES) in "htop" larger than committed memory from jcmd ?