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.

Bug 237864 - [heapwalker] heap model can use less memory
Summary: [heapwalker] heap model can use less memory
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Engine (show other bugs)
Version: 7.3
Hardware: All All
: P3 normal (vote)
Assignee: Tomas Hurka
URL:
Keywords: VISUALVM
Depends on:
Blocks:
 
Reported: 2013-10-31 14:22 UTC by Tomas Hurka
Modified: 2014-01-07 09:24 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Hurka 2013-10-31 14:22:53 UTC
org.netbeans.lib.profiler.heap.StringSegment has a big HashMap<Long,Long>. In 700M heap dump, it has about 600000 entries and consumes over 50M of memory. The memory consumption of the StringSegment instance can be improved by replacing HashMap<Long,Long> with a special type of map. It uses long[] to store the key/values pairs (similar idea is used in IdentityHashMap, where key/value pairs are stored in Object[]). Such map consumes around 15M in the same heap dump.
Comment 1 Tomas Hurka 2013-10-31 15:49:55 UTC
Fixed in profiler-main

changeset:   266015:ca4b9d2ce94a
user:        Tomas Hurka <thurka@netbeans.org>
date:        Thu Oct 31 16:30:02 2013 +0100
summary:     issue #237864, use LongHashMap instead of HashMap<Long,Long>