maven-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin W. Kirst" <>
Subject Re: to delete windows build ?
Date Sat, 21 Nov 2015 11:29:33 GMT

regarding the System.gc() hack it's close to impossible to say how much
gets freed.
According to
only unsed object references are discovered and _may_ get released.
AFAIK streams or file handles aren't closed by GC directly, but
sometimes when
the finalyze() is implemented this may work.
E.g. consider the Inflater *1) has a end() method which frees up the
memory resources (because inflater uses zlib via JNI).
As long as such Inflater objects aren't garbage collected they can
occupy huge amount of memory.
To avoid such, its recommended to use try-finally constructs or
try-resources (Java7)
to explicitly release the resources.
Knowing this makes me even more wonder, why the comments in ShadeMojo:643
state that there are unclosed streams are freed.



Am 21.11.2015 um 11:13 schrieb Hervé BOUTEMY:
> [...]
> Do you have an idea of how much recoverable such leaks are with the 
> System.gc() hack?
> [...]

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message