question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Memory leak in some cases

See original GitHub issue

The 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.

Example with restarts

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
danduk82commented, May 25, 2020

@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

0reactions
danduk82commented, May 26, 2020

@pvalsecc thanks for the hint 😉

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found