Lost object in class workspace comparison
I do not see the object in class workspace comparison.
I am optimizing memory traffic in my project. I made a memory snapshot from a test run (traffic). It shows instances of all my classes, including the one I was going to make into a structure. Then I made this class a structure and repeated the run. After that I used the comparison between snapshots. To my surprise this class was not there. That is, it is not in (A) or (B) column.
Comparison:
Before making struct:
I suspect that the comparison does not work correctly because in the second snapshot this object (now struct) has never been allocated on the heap.
Please sign in to leave a comment.
I conducted an experiment and specially boxed one instance of the ParserContext in the beginning of test run. Then I saw this one instanc in a new workspace chart. But when I try to compare this workspace with previous workspace where this object was a class, I again do not see it.
It seems to me that dotmemory will not be able to correctly show objects that have changed their "kind": struct <-> class. The bad thing is that even if you take into account that you do not need to compare such "mutated" instances (that is, consider them different types), you still need to show them in comparison in DIFFERENT LINES. Now information about them is completely lost.
All of the above is based on my guesses about the internal behavior of dotmemory comparison window. I would be grateful for the help.
One more observation. If you take a snapshot, then remove the class from the assembly and take another spapshot, then this class disappears from the comparison window. In my opinion, the expected behavior in this case should be 0 instances of this class for second snapshot in the comparison window. Now this information is completely lost.
Discussed in YouTrack: https://youtrack.jetbrains.com/issue/DMRY-7784
Currently, traffic comparison between different workspaces is not implemented in dotMemory. You're welcome to vote for the feature requests:
https://youtrack.jetbrains.com/issue/DMRY-3333
https://youtrack.jetbrains.com/issue/DMRY-3334
"Compare with snapshot from another workspace" compares snapshots from different workspaces and shows only objects existing in the snapshot (the objects remained in memory after GC).