Print at Dec 20, 2025, 6:56:14 AM View all posts in this thread on one page
Posted by dimm at May 23, 2012, 10:52:06 PM
How to free resources?
I'm trying to figure out how to free resources. My plugin generates many furniture pieces. I delete everything before running another run, but it seems the memory is never reclaimed.

Memory: 49,892K Free: 6,861K (13%) ... completed.
Memory: 239,752K Free: 11,121K (4%) ... completed.
Memory: 676,348K Free: 284,126K (42%) ... completed.
Memory: 753,096K Free: 215,793K (28%) ... completed.
Memory: 979,672K Free: 423,821K (43%) ... completed.

What is the proper way to reset the Plugin Home instance?
Thanks for your help.

Posted by dimm at May 24, 2012, 1:15:01 PM
Re: How to free resources?
The issue seems to be in Top View. It consumes 10 times more memory than "Catalog Icons View" per run and never releases the resources. I have a hundred plain boxes which in "Catalog Icons" mode render real time on top, but take a minute or two to render in "Top View" mode. All are the same (cloned) and have the same color (no textures). The bottom (3D view) renders fine in both cases.

Posted by dimm at May 29, 2012, 3:54:09 PM
Re: How to free resources?
Deleting plan furniture does not delete the top view from the cache. To clear it toggle setFurnitureViewedFromTop.
Settings.plugin.getUserPreferences().setFurnitureViewedFromTop(false);
Settings.plugin.getUserPreferences().setFurnitureViewedFromTop(true);

Posted by Puybaret at May 29, 2012, 7:24:52 PM
Re: How to free resources?
The cache of icons seen from top is managed by furnitureTopViewIconsCache field in PlanComponent class. This cache is an instance of java.util.WeakHashMap and its entries will be released when furniture of the plan will be out of reach. Check your plug-in correctly frees the references to HomePieceOfFurniture instances otherwise this cache can't be emptied.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator