Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Test and Performance Tools Platform (TPTP) » Memory stats missing some objects?(Profiling my app doesn't show all allocated objects)
icon5.gif  Memory stats missing some objects? [message #665798] Sat, 16 April 2011 04:00
Jim Marshall is currently offline Jim MarshallFriend
Messages: 1
Registered: April 2011
Junior Member
Hi,
New to TPTP but not Eclipse or Java. I'm trying to use TPTP to see the memory usage of my app, but I am not seeing all the objects.

Platform
Windows 7 (64-bit)
Eclipse 3.6.2
TPTP 4.7.1

TPTP was installed via the Eclipse "Add new Software" option.

I've spent about 2 hours looking over the TPTP site and couldn't find anything relevant.

Anyway, I made a simple Java app and profiles it. The app consists of a class which has an ArrayList memory in which I create 100 strings and place it in that ArrayList. When I run the application via the "Profile profile Test", I setup to do "Memory Analysis" and I also check the "Track object allocation sites". The program runs and look at the Memory Statistics and all it shows in the class itself, with 1 allocation and a size of 16. It doesn't show any information on the strings or the array list.

As an additional test I also allocated an ArrayList in the 'main' function and added strings to that and still they do not appear on the memory stats page.

Can anyone tell me what I am doing wrong?

Here is the simple program I tried:

public class ProfileTest {
	
	private List<String> strings;

	public ProfileTest() {
		super();
		strings = new ArrayList<String>();
	}
	
	private void addStrings() {
		for (int x = 0; x < 100; x++) {
			String  str = String.format("%03d", ((int)(Math.random() * (double)x) + 1));
			strings.add(str);
		}
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ArrayList<String> foo = new ArrayList<String>();
		String f = new String("WTF!");
		foo.add(f);
		
		ProfileTest t = new ProfileTest();
		t.addStrings();
	}
}


In terms of TPTP the "Memory Statistics" has one row populated which says:

Class Name             Live INstances       Active Size
ProfileTest                  1                                 16


There is also a Total Instances & total Size colums which have the same values and finally a Avg Age column which has 0 in it.

In the Allocation Details tab it shows Method as Main line no, class Profiletest and the live instances, Active size etc....

Any help appreciated
Previous Topic:It doesn't run my product anymore
Next Topic:Changes in TPTP PMC and project leadership
Goto Forum:
  


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

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

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

Back to the top