This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The value of this WeakHashMap refers strongly to the key, so neither will ever be collected. In general this kind of problem is unsolvable in Java: http://bugs.sun.com/view_bug.do?bug_id=6389107 In this case the cache can probably be strong only for layers currently modified in memory, else use SoftReference. (Found in a heap dump where a NbModuleProject was leaked this way.)
core-main #e8b2c6684490