Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Memory Analyzer (MAT) » New inspectors
New inspectors [message #7161] Wed, 19 November 2008 19:42 Go to next message
Eclipse UserFriend
Originally posted by: cgrinds.us.ibm.com

In the work I do I've found these 2 inspectors useful.

1) Find strings that retain wasteful char arrays.
This helps find the common problem of a string holding onto a larger than
necessary char[] due to substring(), XML, regex, etc.

In one of my recent heaps this inspector found 16,546 strings backed by a
larger than necessary char[]. For example, the largest "wasted" String has
a length of 251, while it retains a char[] of length 25,546 - and it's the
only reference! That's quite a waste that's easy to fix.

2) Find primitive arrays with a constant value
This started with a more specific inspector that found SWT image(data)s
that were blank. Someone was create lots of images for a cache but never
actually using/drawing into them so they just wasted Java heap. I realized
that the specific image inspector can be extrapolated into a general array
constant value inspector.

If I run this inspector across a recent heap I see 1.3MB wasted by the top
8 offenders. For example someone created a byte[] of size 880,256 but every
entry of that array has the same value.

If you're interested in any of these, let me know,
Chris
--
Chris Grindstaff
cgrinds@us.ibm.com
Re: New inspectors [message #7282 is a reply to message #7161] Thu, 20 November 2008 11:45 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas BuchenFriend
Messages: 123
Registered: July 2009
Senior Member
Hi Chris,

I'd love to get my hands on those two inspections. The Eclipse way is to
create a bugzilla entry and attach the patch / files. This way it shows up
in the IP log and the list of contributions.

It will be interesting to run the "constant values in primitive arrays"
query on our heap dumps. I haven't look at it that way yet.

Kind regards,

- Andreas.
Re: New inspectors [message #7299 is a reply to message #7282] Thu, 20 November 2008 11:46 Go to previous messageGo to next message
Andreas Buchen is currently offline Andreas BuchenFriend
Messages: 123
Registered: July 2009
Senior Member
And this is the bugzilla URL:
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=MAT
Re: New inspectors [message #7635 is a reply to message #7282] Thu, 20 November 2008 13:17 Go to previous message
Eclipse UserFriend
Originally posted by: cgrinds.us.ibm.com

andreas.buchen@sap.com (Andreas Buchen) wrote in
news:ea30fd2f27e9b68eccdb500ca1731968$1@www.eclipse.org:

> Hi Chris,
>
> I'd love to get my hands on those two inspections. The Eclipse way is
> to create a bugzilla entry and attach the patch / files. This way it
> shows up in the IP log and the list of contributions.
>
> It will be interesting to run the "constant values in primitive
> arrays" query on our heap dumps. I haven't look at it that way yet.
>

Hi Andreas,
As you said, I'll attach to a bugzilla entry.

-Chris
--
Chris Grindstaff
cgrinds@us.ibm.com
Previous Topic:Minor CSVOutputter patch - 1 attachment
Next Topic:can MAT use PHD? (or only HPROF?)
Goto Forum:
  


Current Time: Fri Apr 19 10:24:06 GMT 2024

Powered by FUDForum. Page generated in 0.04035 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top