Memory leak in some cases
See original GitHub issueThe profiler tends to show a huge amount of objects in relation with XML schema caches deep down within dependencies of GeoTools.
The suspect is a layer with a SLD and a filter:
...
},{
"type": "GML",
"name": "zoom",
"url": "http://mapserver/mapserv?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAMES=agri_parcels_print,agri_parcels_finished_print&FILTER=%28%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Eid%3C/PropertyName%3E%3CLiteral%3E${exchangeProperty.parcelId}%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E%29%28%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3Eid%3C/PropertyName%3E%3CLiteral%3E${exchangeProperty.parcelId}%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E%29",
"style": "no_display"
}],
"projection": "EPSG:2056",
"rotation": 0
},
"scale": 80000,
"style": {"style": '<?xml version="1.0" encoding="UTF8"?><StyledLayerDescriptor version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <NamedLayer><Name>no_display</Name><UserStyle><Title>Default Line</Title><FeatureTypeStyle></FeatureTypeStyle> </UserStyle> </NamedLayer></StyledLayerDescriptor>'}
},
"layout": "A4 portrait ${exchangeProperty.canton}"
}
The current, but very ugly work around is to add those to CATALINA_OPTS (works only if you have something restarting your web server):
-XX:GCTimeLimit=70 -XX:GCHeapFreeLimit=5 -XX:+ExitOnOutOfMemoryError
Some prints will fail, but the print at least restarts.

Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >Understanding Memory Leaks in Java - Baeldung
A Memory Leak is a situation where there are objects present in the heap that are no longer used, but the garbage collector...
Read more >How to Detect Memory Leaks in Java: Causes, Types, & Tools
A memory leak is a situation where unused objects occupy unnecessary space in memory. Unused objects are typically removed by the Java ...
Read more >What is Memory Leak? How can we avoid? - GeeksforGeeks
Memory leak occurs when programmers create a memory in heap and forget to delete it. The consequences of memory leak is that it...
Read more >Hunting Java Memory Leaks - Toptal
A memory leak occurs when object references that are no longer needed are unnecessarily maintained. These leaks are bad. For one, they put...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@svavoi do you have some test data/layers that reproduce this problem that I can use? I am trying to dig into this. Thanks in advance
@pvalsecc thanks for the hint 😉