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 83029 - Unable to expand large byte[] values in Instances window
Summary: Unable to expand large byte[] values in Instances window
Status: RESOLVED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Jiri Sedlacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-18 21:36 UTC by _ gsporar
Modified: 2007-01-02 12:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
sample heap snapshot (2.30 MB, application/octet-stream)
2006-08-18 21:37 UTC, _ gsporar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ gsporar 2006-08-18 21:36:11 UTC
NB 6.0 M2 w/Profiler M2 running on JDK5u8.

I am not sure if this is a bug or not.  The attached heap snapshot file
demonstrates the problem:

1. Open the heap snapshot.
2. In the Classes window use the filter to locate the ProductionModel class.
3. Right-click it and choose Show in Instances View.
4. Select instance #1.  
5. Over in the Fields window there is an entry for [] values. Click the plus
sign icon next to it.

This resulted in an OutOfMemoryError, even though the IDE was running with -Xmx512m.

Note that the source for ProductionModel looks like:

public class ProductionModel {
    
    private final static int size = 25;

    private byte[] values = new byte[size*1024*1024];
                                     
    
    /** Creates a new instance of ProductionModel */
    public ProductionModel() {
    }
    
}

So even with a 512mb heap, the heap walker was unable to expand the 25mb byte
array.  Is that a known limitation?
Comment 1 _ gsporar 2006-08-18 21:37:10 UTC
Created attachment 33082 [details]
sample heap snapshot
Comment 2 Tomas Hurka 2006-08-18 21:42:25 UTC
Yes, we know about this problem. The same happens when you have dump with 1000000 instances of 
same class. It is current limitation, which Jirka plans to fix. 
Comment 3 Jiri Sedlacek 2006-08-18 21:43:04 UTC
The problem is that HeapWalker tries to display 26214400 items of the array -
for each item a TreeNode has to be created. OutOfMemoryError is quite expectable
for such case. This will be solved soon by showing only first N items of the
array and collapsing the others as described in Issue 82051.
Comment 4 Tomas Hurka 2007-01-02 12:59:49 UTC
Fixed in trunk.