Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 282952

Summary: Memory Analysis show no data collection after reattac.
Product: z_Archived Reporter: Eugene Chan <ewchan>
Component: TPTPAssignee: Chengrui Deng <chengrui.deng>
Status: CLOSED FIXED QA Contact: Kathy Chan <kathy>
Severity: major    
Priority: P1 CC: analexee, asaf.yaffe, chengrui.deng, jgwest, yunan.he
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: Milestone3 adopter
Attachments:
Description Flags
Memory analysis result with PerformanceExample
none
snap shot of my 4521
none
Inconsistent objects allocation info between Memory Statistics and Allocation Details
none
screen capture none

Description Eugene Chan CLA 2009-07-08 23:17:16 EDT
This is a follow up of bug 282531 where memory analysis does not collect any data after reattach action.
Comment 1 Chengrui Deng CLA 2009-07-08 23:48:31 EDT
Please note, if you profile test case PerformanceExample directly without reattach, there is also no data collection for memory analysis.
Comment 2 Eugene Chan CLA 2009-07-09 10:36:36 EDT
> Please note, if you profile test case PerformanceExample directly without
> reattach, there is also no data collection for memory analysis.
> 

Chengrui, Could you give more information about this? I run a test on PerformancexExample directly without any detach or reattach and I see memory analysis data in the tptp.sdk-TPTP-4.5.2.1-200907030940 and 4.6 GA builds.

Raising priority and severity of the defect. This should be considered in both 4521 and 46(In reply to comment #1)
Comment 3 Chengrui Deng CLA 2009-07-10 04:50:11 EDT
Created attachment 141273 [details]
Memory analysis result with PerformanceExample

Hi, Eugene,
I download latest TPTP 4.5.2.1 branch platform.jvmti.runtime code from Eclipse CVS server. Build the profilers and using it to execute memory analysis with PerformanceExample. Without reattach, there is no data when profiling finish both for IBM's and SUN's JVM.

This attachment is a snapshot after profiling finish.

Thanks,
Chengrui
Comment 4 Eugene Chan CLA 2009-07-10 10:24:30 EDT
(In reply to comment #3)
> Created an attachment (id=141273) [details]
> Memory analysis result with PerformanceExample
> 
> Hi, Eugene,
> I download latest TPTP 4.5.2.1 branch platform.jvmti.runtime code from Eclipse
> CVS server. Build the profilers and using it to execute memory analysis with
> PerformanceExample. Without reattach, there is no data when profiling finish
> both for IBM's and SUN's JVM.
> 
> This attachment is a snapshot after profiling finish.
> 
> Thanks,
> Chengrui
> 

How about a vanilla tptp.sdk-TPTP-4.5.2.1-200907030940 build? instead of a built profiler?
Comment 5 Chengrui Deng CLA 2009-07-13 03:32:36 EDT
(In reply to comment #4)
> (In reply to comment #3)

> How about a vanilla tptp.sdk-TPTP-4.5.2.1-200907030940 build? instead of a
> built profiler?
> 

I replaced Eclipse self-contained profilers with profilers in tptp.sdk-TPTP-4.5.2.1-200907030940 on WindowsXP. Without reattach, there is no data when profiling finish both for IBM's and SUN's JVM. 

I will try to find the cause of this bug. 
Comment 6 Chengrui Deng CLA 2009-07-16 09:25:38 EDT
Hi, Eugene,
I tested with tptp.sdk-TPTP-4.5.2.1-200907030940 and latest TPTP 4.5.2.1 again. It is found if profiling option "Automatically determine filtering criteria" is checked, no data will be collected whether profiling directly or reattach. If this option is unchecked, profiling data will be reported. Please check.

Thanks,
Chengrui
Comment 7 Eugene Chan CLA 2009-07-16 10:59:33 EDT
Created attachment 141788 [details]
snap shot of my 4521

Hi, I import the PerformanceExample.java into a fresh 4521 workspace and start a Java application launch configuration in profile mode, with the default auto filter option. I see profiling data of the classes shown in the Object Allocation view. 
I run the test with both IBM JRE 1.5 and SUN JRE 1.6.
Comment 8 Chengrui Deng CLA 2009-07-17 00:38:40 EDT
(In reply to comment #7)
> Created an attachment (id=141788) [details]
> snap shot of my 4521
> 
> Hi, I import the PerformanceExample.java into a fresh 4521 workspace and start
> a Java application launch configuration in profile mode, with the default auto
> filter option. I see profiling data of the classes shown in the Object
> Allocation view. 
> I run the test with both IBM JRE 1.5 and SUN JRE 1.6.
> 
It seems this problem is introduced by CGProfTracker filtering introduced by bug 194081. After this filtering mechanism has been modified in the patch of bug 282533, the problem is solved.
Comment 9 Eugene Chan CLA 2009-07-17 09:41:00 EDT
Chengrui, so you get data when you launch the application, right? The remaining problem is no memory analysis data after reattach.
Comment 10 Chengrui Deng CLA 2009-07-18 03:45:40 EDT
(In reply to comment #9)
> Chengrui, so you get data when you launch the application, right? The remaining
> problem is no memory analysis data after reattach.
> 
I also tested with reattach scenario, it also can get memory analysis data when "Automatically determine filtering criteria" is unchecked.
Comment 11 Chengrui Deng CLA 2009-07-19 23:26:52 EDT
(In reply to comment #9)
> Chengrui, so you get data when you launch the application, right? The remaining
> problem is no memory analysis data after reattach.
> 
Hi, Eugene,
I build the latest TPTP 4.5.2.1 code and testing with the profilers. It is found when "Automatically determine filtering criteria" is checked, after reattach no memory analysis data is collected as you reported now. I am investigating the problem, any update I will report on Bugzilla.

Thanks,
Chengrui
Comment 12 Chengrui Deng CLA 2009-07-22 03:48:27 EDT
Hi, Eugene,
It is found the test results with PerformanceExample reattach are as designed. The details as below.

1. Test case PerformanceExample analysis

The test results are determined by whether the profiling option "Automatically determine filter" is checked or not. In the test case PerformanceExample source code, you can find except for the object related with class PerformanceExample, other objects are related with java.awt.* classes, such as Button, Panel etc.


2. Profiling option "Automatically determine filter" and java.awt.* classes

When "Automatically determine filter" is checked, all awt related objects will be not reported in memory analysis. You can verify profiling results by memory profiling directly, comparing "Automatically determine filter" is checked and not checked.

3. Profiling PerformanceExample analysis

The simplest testing method is to start memory profiling with PerformanceExample, not click "add" button in test application and deattach direclty. Then attach at once and click "add" button to add several new buttons.

You can find four objects belong to PerformanceExample, PerformanceExample$1, PerformanceExample$2 and PerformanceExample$3 have been allocated in profiling session before reattach happen. If "Automatically determine filter" is not checked, you will see Button objects are allocated after reattach, otherwise you can not get any profiling data after reattach.

4. Problems in Memory Statistic UI

When new Button objects are allocated when profiling, you can get correct Button objects allocation info in "Allocation Details" view, however in "Memory Statistics" view, the new allocated Button objects number info is not shown correctly. This problem is not related with reattach.

====================================================

So IMHO, bug 282952 should be closed. And a new bug related with Memory Statistic UI problem should be filed.

Thanks,
Chengrui
Comment 13 Chengrui Deng CLA 2009-07-22 03:54:36 EDT
Created attachment 142234 [details]
Inconsistent objects allocation info between Memory Statistics and Allocation Details

This is the snapshot of inconsistent objects "java.awt.Button" allocation info I got in testing process. You can found just two allocated Button objects in "Memory Statistics", while seven Buttons have been created actually which is shown correctly in "Allocation Details" view.
Comment 14 Eugene Chan CLA 2009-07-22 12:48:09 EDT
Created attachment 142294 [details]
screen capture

I tried reproduce the problem you mentioned but I see both Memory Statistics and Allocation Details tabs show correct values. Could you make sure you refresh your views?
Comment 15 Eugene Chan CLA 2009-07-22 13:19:32 EDT
I have confirmed that if the java.awt* INCLUDE is added to the filter list (in both Java Application or External Java Application) there is data collected for reattach.
I am closing this bug. If there is a need for follow up on the UI issue, please open a separate defect for that.
Comment 16 Chengrui Deng CLA 2009-07-23 00:01:19 EDT
(In reply to comment #14)
> Created an attachment (id=142294) [details]
> screen capture
> 
> I tried reproduce the problem you mentioned but I see both Memory Statistics
> and Allocation Details tabs show correct values. Could you make sure you
> refresh your views?
> 

I tried with the TPTP-4.5.2.1-200907211032 build, the problem still exists. I have filed bug 284362 to trace the problem. Please see the details in bug 284362 about how to reproduce the problem.

Thx,
Chengrui
Comment 17 Kathy Chan CLA 2009-10-16 16:52:43 EDT
Closing.