use of net.runelite.api.RenderOverview in project runelite by runelite.
the class Hooks method checkWorldMap.
/**
* When the world map opens it loads about ~100mb of data into memory, which
* represents about half of the total memory allocated by the client.
* This gets cached and never released, which causes GC pressure which can affect
* performance. This method reinitailzies the world map cache, which allows the
* data to be garbage collecged, and causes the map data from disk each time
* is it opened.
*/
private static void checkWorldMap() {
Widget widget = client.getWidget(WORLD_MAP, 0);
if (widget != null) {
return;
}
RenderOverview renderOverview = client.getRenderOverview();
if (renderOverview == null) {
return;
}
WorldMapManager manager = renderOverview.getWorldMapManager();
if (manager != null && manager.isLoaded()) {
log.debug("World map was closed, reinitializing");
renderOverview.initializeWorldMap(renderOverview.getWorldMapData());
}
}
Aggregations