Memory leak in jdk.javadoc.internal.doclets.toolkit.WorkArounds

Jonathan Gibbons jonathan.gibbons at oracle.com
Fri Sep 27 18:35:41 UTC 2019


Florian,

I looked at the code: this is definitely a design bug.

There appears to be no reason for it to be static, and removing the 
`static` modifier
does not cause any compilation issues.

There's some minor cleanup we could do in this area as well, to use 
Map::computeIfAbsent,

Filed: https://bugs.openjdk.java.net/browse/JDK-8231587

-- Jon


On 09/27/2019 02:11 AM, Florian Weimer wrote:
> It seems that it's currently very difficult to use the javadoc tool in
> a long-running VM because there is a severe memory leak.
>
> This appears to be related to the class
> jdk.javadoc.internal.doclets.toolkit.WorkArounds, specifically the
> field serializedForms.  It looks like elements are never removed from
> this map.  Furthermore, even if compiling the same sources over and
> over again, existing entries are not reused.
>
> Does this field have to be static?  What's the purpose of this
> construct, anyway?  Is it more than just a cache?



More information about the javadoc-dev mailing list