Joined: Apr 4, 2012
Post Count: 10
Status:
Offline
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.
Joined: Apr 4, 2012
Post Count: 10
Status:
Offline
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.
Joined: Apr 4, 2012
Post Count: 10
Status:
Offline
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);
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
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