jnanomsg
jnanomsg copied to clipboard
PullSocket probably has memory leak
This is just an assumption, but I am pretty sure, that it is.
System: Ubuntu 16.04.
Steps to reproduce.
- Download https://github.com/georgy7/jnanomsgdemo/tree/0e520b45afd2a8750adc11bef51dbbdb2fa47c83
- Build and run it with the flag
-Xmx512m
or even also with-XX:MaxMetaspaceSize=128m
. - Run the script https://github.com/georgy7/jnanomsgdemo/blob/0e520b45afd2a8750adc11bef51dbbdb2fa47c83/examples/send_folder.d for some folder with 500‒100 of big JPEGs.
dub run --single --force send_folder.d
You will get 1‒3 GB of used RAM by the process instead of 512‒1024m. But if you open JConsole, for example, you'll see, that even sum of all commited RAM is much smaller. Actually, I do nothing with the received data in the code. So, I think, the native code is the only thing could hold the memory in this case.
$ file /usr/lib/x86_64-linux-gnu/libnanomsg.so
/usr/lib/x86_64-linux-gnu/libnanomsg.so: symbolic link to libnanomsg.so.0.2.1
$ file /usr/lib/x86_64-linux-gnu/libnanomsg.so.0.2.1
/usr/lib/x86_64-linux-gnu/libnanomsg.so.0.2.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=0f831e339661cf4c7f650e67e600941b138ea127, stripped
PUB/SUB is also have this error。When the app running a long time ,the linux top RES is increasing