Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

list of currently existing objects

Former Member
0 Kudos

Hi,

does anybody know whether there is a possibility to have a look at the list of existing objects at some point in time (during the execution of my application)? That is, can I put a breakpoint somewhere in my code and check which objects currently exist and maybe which other objects will get deleted with the next garbage collection?

Regards,

Sebastian Kamp

1 ACCEPTED SOLUTION

former_member183804
Active Contributor
0 Kudos

If you are on 620 you may use S_MEMORY_INSPECTOR. When within debug mode you can write an dump of the memory allocation to file. Later on you can analyse this data.

Of course there is no View for objects not referred ( freed by next gc run). But you can do diffs and SZK ( starke zusammenhangs komponenten ) analysis.

Best Regards

Klaus

3 REPLIES 3

former_member183804
Active Contributor
0 Kudos

If you are on 620 you may use S_MEMORY_INSPECTOR. When within debug mode you can write an dump of the memory allocation to file. Later on you can analyse this data.

Of course there is no View for objects not referred ( freed by next gc run). But you can do diffs and SZK ( starke zusammenhangs komponenten ) analysis.

Best Regards

Klaus

0 Kudos

Hi Klaus,

thanks for the hint, interesting! Why do you think there is no View for objects not referred to (thus freed by next gc run) anymore? I mean the runtime environment itself must have a list of all objects ever instantiated and not yet destroyed/freed by the gc. I'd expect the gc evaluates such a list from time to time and all object in the object graph not reachable from (where?) some root will get deleted from the list. That is also entire strong components might get deleted, what do yo think?

Also the output table of S_MEMORY_INSPECTOR contains a column with the title 'number of instances' and I have a lot of objects that have a 0 entry here and no other objects referring to them. What is that supposed to mean (if not a sign for soon collection by the gc)?

Regards,

Sebastian

0 Kudos

Hello Sebastian,

I think there is some kind of misunderstanding. I just dont know an easy mechanism to display objects which will be freed by GC.

As far I know ABAP uses mark and sweep. Maybe you can try to trigger GC in the debugger (Jump/System/GC/..). If you compare a memory dump before and after and there is a difference you have got the desired info. (But i fear memory_inspector does an gc implecitely).

I am also no expert in S_Memory_Inspector, but I think this column (number of instances) tells the total number of instances of a certain class. 0 Instances just tell there are no one.

Kind Regards

Klaus