Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 193797 - On pause monitoring memory data is still collected
Summary: On pause monitoring memory data is still collected
Status: CLOSED WORKSFORME
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: TPTP (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P2 critical (vote)
Target Milestone: ---   Edit
Assignee: Samson Wai CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-21 13:42 EDT by Eugene Chan CLA
Modified: 2016-05-05 10:42 EDT (History)
6 users (show)

See Also:


Attachments
Test case showing the correct behaviour (2.59 KB, application/octet-stream)
2007-08-30 14:46 EDT, Samson Wai CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eugene Chan CLA 2007-06-21 13:42:25 EDT
This is a follow up of bug 192300:

As captured and modified from bug 192300:
Launch the attached application from a command line in profiling mode using the
-XrunpiAgent command. Create an attach configuration selecting BOTH Memory and Execution Analysis, add the following filter "java.awt.Button INCLUDE" and "* EXLUDE" and attach to the application. Open the Memory Satistics view. Click twice on the Add button of the test application, observe that the view displays 4 instances of the java.awt.Button class. Pause monitoring and click two times more on the Add button, refresh the view, no changes are displayed which is correct. Resume monitoring and click again two times on the Add button and refresh the view, observe that now the number of Button instances is 8 instead of 6.The same behaviour is observed when profiling to file, instances that are created while in pause mode are added to the total number of instances. 

For this use case : select BOTH PI memory and execution analysis,
<option key="STACK_INFORMATION" value="normal"/> 
is sent to agent correctly, but it's treated as 
<option key="STACK_INFORMATION" value="contiguous"/>
Comment 1 Samson Wai CLA 2007-06-21 13:57:34 EDT
Updated sizing.
Comment 2 Raheel Ashraf CLA 2007-06-28 12:46:37 EDT
Testing with TPTP 4.3.1 and AC 4.3.1 I saw the same problem
Comment 3 Samson Wai CLA 2007-06-29 12:16:29 EDT
I think this might be related to aggregation. Adding Ali to the cc: list.

What I have noticed is that when I attach to the running PerformanceExample application under enabled mode, I immediately get 2 instances of Button. This is happening when both execution stat and memory analysis are chosen.

When only memory analysis is selected, I guess aggregation is not kicked in so the correct result is shown.
Comment 4 Valentina Popescu CLA 2007-06-29 16:15:53 EDT
Update priority to P2 to flag that this is at risk for 4.4.0.1 due to resources not being available to work on this.
Comment 5 Harm Sluiman CLA 2007-07-06 07:27:07 EDT
Samson, what is the outlook for this defect? We need to shut down 4.4.0.1 and htis appears to be an important defect to clear.
Comment 6 Raheel Ashraf CLA 2007-07-06 12:04:50 EDT
Reply comment #3:
for Execution Time Analysis, if I select the "show execution flow graphical details" option instead of the default one (to disable the aggregation), I still see the same problem. So I guess the problem lies somewhere else

reply comment #5:
I am looking at it today.
Comment 7 Samson Wai CLA 2007-07-17 14:41:46 EDT
4.4.0.1 has been closed down.
Comment 8 Samson Wai CLA 2007-08-30 14:46:44 EDT
Created attachment 77401 [details]
Test case showing the correct behaviour
Comment 9 Samson Wai CLA 2007-08-30 15:01:32 EDT
The attached test case will show that the piAgent is working as designed.

The test program "TestObject" will create 10 instances of "TestObject2". Try running it with "-XrunpiAgent" and attach to the agent. The instances created when monitoring is paused will not be shown in the memory stat views.

The reason is that none of the "TestObject2" method is being called. After resuming from the paused state, the test program "TestObject" will go on creating new instances of the "TestObject2" class and never revisit the previously created instances. Therefore the piAgent does not have to process the missing stack entries.

For the original "PerformanceExample" test case, apparantly the Button instances created during the pause are being "revisited" after resume. This may be something like widget refresh caused by a change in the UI layout. Since the execution histroies are being collected as well, any method entry/exit calls which does not have a corresponding object associated will be recreated by the piAgent's "processMissingStackEntries()" function. This will try to find the object reference and if it does not exist in the current hash (due to stop monitoring) the piAgent will recreate the object and therefore reappear in the memory stat view. This can explain why it does not happen if only memory stat is collected.

I will mark this as "working for me".
Comment 10 Samson Wai CLA 2007-08-30 15:02:04 EDT
Adjust sizing.
Comment 11 Eugene Chan CLA 2009-02-24 17:10:00 EST
CLOSE BUG