Manage native memory

5
Last we had a application crash executed by the OS because the JVM process took to much memory from the OS. Checking the graph I see that the native memory is really large and was only climbing in just 7 days. The strange thing is that the application is doing nothing: no large background processes, 2 users that are logged in for a few minutes. On other applications we encounter the same issues, but on other not. I'm trying to find a pattern. 1 thing I discovered was difference in the amount of threads. The apps with issues was around 110 and other around 70. On difference in applications is the usage of the 'Process Queue' module from the appstore. This is a module that creates and runs threads al the time. Only having this module will let the native memory be increased wihout even using the module. On my application the usage of this module wasn't implemented yet. My question is if other people also have this issue or see a difference in the 'Process Queue' usage? I know the native memory will stabilize it self over time because allocated memory will be reused by new threads, but 0.8Gb native memory on 1Gb JVM is a little bit too much.
asked
4 answers
2

Hi joel, thanks for the info. Investigating native memory issues is on our agenda, but for now we were suspecting the metro library to be leaking memory. Do you use process queue in combination with web services?

answered
0

The native memory is an extra piece outside of the JVM, that is visualized in the graphs of the Mendixcloud. The memory is mostly used by Java threads. Each Java thread takes a piece of extra memory beside the JVM in the native memory. That piece has a default value and when a thread is ended it release to be reused for a new thread. In the graph you see that the native memory is stabilizing along the way.

I've seen an interesting page what explains the native memory: http://www.ibm.com/developerworks/linux/library/j-nativememory-linux/index.html

My deeper question is: why is the uses of the native memory a lot more when I use the process queue in an app vs when I don't use it? Even when the process queue isn't implemented in the application to be used so there aren't any threads triggered by the process queue.

answered
0

I have had similar (or even worse actually) experiences with the process queue module as well. I am pretty sure one of the problems at least is the way Mendix handles system sessions. I do not have any hard evidence that Mendix is still leaking memory for system sessions but it did so in the past.

answered
0

I also have had similar an experience.

Hasn't this issue been settled yet?

answered