The "Object Explorer" view seems to not display information about System.String objects correctly.
(Excuse the ASCII art):
Name Retained Size Shallow Size
tableNamespace System.String 18 18
m_arrayLength = Int32 1920298841 0x72756F59
m_firstChar = Char '丮' '\u4E2E' 2
m_stringLength = Int32 544500043 0x2074694B 4
Clearly, the length of my string isn't 0x2074694B.
Seems like the profiler needs some 'special case' code to deal with System.String (my understanding is that the characters are actually stored 'inside' the object, and the "m_firstChar" field is, so to speak, the "last" field in System.String, whose address is the start of the character string. (I've also read somewhere where .Net 4.0 changed this some (above example is from .Net 2.0)).
This is a .Net 4.0 example: https://gist.github.com/rednaxelafx/7244863
This is for .Net 2.0, but also contains a comment about m_arrayLength not being present in 4.0:
http://stackoverflow.com/questions/5240 ... ring-value
Thanks,
Jeremy
YourKit 2013 and System.String Object Explorer View
-
- Posts: 7
- Joined: Wed May 28, 2014 8:45 pm
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: YourKit 2013 and System.String Object Explorer View
Hi Jeremy
Thank you for reporting this issue.
We have managed to reproduce the problem with v2013.
In our tests, we see always one string per snapshot with such incorrect fields. How many bad string do you see?
Anyway, we can't reproduce the problem with the latest code base which will eventually become the next version, 2014. Perhaps it was fixed as a side effect of other improvements and fixes we have made since v2013.
Could you please try running profiled applications with the following build based on the latest source code:
http://www.yourkit.com/download/tmp/201 ... -14502.exe
Do you still see the problem with it?
Best regards,
Anton
Thank you for reporting this issue.
We have managed to reproduce the problem with v2013.
In our tests, we see always one string per snapshot with such incorrect fields. How many bad string do you see?
Anyway, we can't reproduce the problem with the latest code base which will eventually become the next version, 2014. Perhaps it was fixed as a side effect of other improvements and fixes we have made since v2013.
Could you please try running profiled applications with the following build based on the latest source code:
http://www.yourkit.com/download/tmp/201 ... -14502.exe
Do you still see the problem with it?
Best regards,
Anton
-
- Posts: 7
- Joined: Wed May 28, 2014 8:45 pm
Re: YourKit 2013 and System.String Object Explorer View
Hello,
>>>
In our tests, we see always one string per snapshot with such incorrect fields. How many bad string do you see?
<<<
Interesting, yes, that appears to be the case (1 per snapshot). (The particular "bad" display will occur more than once, if that same String object is referenced by multiple fields, though.).
>>>
Could you please try running profiled applications with the following build based on the latest source code:
<<<
If I open an "old" (from 2013) snapshot with the new code, I see the same bad string.
However, so far, recording/profiling with the new code appears to work correctly.
Thanks,
Jeremy
>>>
In our tests, we see always one string per snapshot with such incorrect fields. How many bad string do you see?
<<<
Interesting, yes, that appears to be the case (1 per snapshot). (The particular "bad" display will occur more than once, if that same String object is referenced by multiple fields, though.).
>>>
Could you please try running profiled applications with the following build based on the latest source code:
<<<
If I open an "old" (from 2013) snapshot with the new code, I see the same bad string.
However, so far, recording/profiling with the new code appears to work correctly.
Thanks,
Jeremy
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: YourKit 2013 and System.String Object Explorer View
Thanks for testing.
Meanwhile, you can use the v2014 build. We are not aware of any regressions.
The wrong information is contained in the snapshot, so it's expected that opening the old snapshot with the new UI doesn't solve the problem, and that it's required to re-run with the new agent to obtain a new, correct snapshot.If I open an "old" (from 2013) snapshot with the new code, I see the same bad string.
Great. We'll investigate whether we can safely backport the necessary fixes to v2013.However, so far, recording/profiling with the new code appears to work correctly.
Meanwhile, you can use the v2014 build. We are not aware of any regressions.
-
- Posts: 7
- Joined: Wed May 28, 2014 8:45 pm
Re: YourKit 2013 and System.String Object Explorer View
One thing I notice is (using the 2014 build) is that it appears that non-empty strings display as so:
[44] System.String "eutestt" 32 32
But that empty strings display as expandable
_columnUri System.String 18 18
m_arrayLength = Int32 0 4
m_firstChar = Char '<displays as square box>' '\u0000'
m_stringLength = Int32 0 4
I'm not sure if that is intentional, or perhaps some sort of side effect of String.Empty?
Regards,
Jeremy
[44] System.String "eutestt" 32 32
But that empty strings display as expandable
_columnUri System.String 18 18
m_arrayLength = Int32 0 4
m_firstChar = Char '<displays as square box>' '\u0000'
m_stringLength = Int32 0 4
I'm not sure if that is intentional, or perhaps some sort of side effect of String.Empty?
Regards,
Jeremy
-
- Posts: 7
- Joined: Wed May 28, 2014 8:45 pm
Re: YourKit 2013 and System.String Object Explorer View
Please disregard the previous message -- I had confused myself by opening up an old snapshot.
Regards,
Jeremy
Regards,
Jeremy