api-gateway icon indicating copy to clipboard operation
api-gateway copied to clipboard

Memory Leak with Groovy header manipulation

Open DJGummikuh opened this issue 6 years ago • 1 comments

We have an issue with membrane where apparently a memory leak with groovy causes some internal classloader hashmap to increase in size over time, causing membrane to eat up all cpu without actually doing anything. I have a heap dump here but I fail to really understand what is causing this. Anybody else witnessed this?

If you can tell me a place where I can upload a heapdump of this size I'll gladly provide it. The accompanying configuration will follow tomorrow, Membrane in use is 4.6.1 or 4.6.2 (honestly can't tell, will check tomorrow)

DJGummikuh avatar Nov 20 '18 16:11 DJGummikuh

Ok I did a little more debugging and it seems that the leak is created with the <groovyTemplate> keyword in my configuration. This keyword is actually not documented but shows up in examples so I used it. Apparently the groovytemplate is compiled and registered to the java class loaders with each invocation of the associated endpoint.

DJGummikuh avatar Nov 26 '18 15:11 DJGummikuh