Tips for interpreting IDEA memory dumps in YourKit?

For one of our internal plugins, some users report severe memory
problems, like 400MB memory usage and >1min lockups. I got some memory
dumps and it looks like things are normal.

The plugin provides CompletionData, ReferenceProvider, and inspections
with a few quickfixes. These are all used only for XML files.

First of all, the user said his memory meter showed 400MB+ usage, but YK
shows retained size as 112MB. What does this mean?

Second, my plugin classes are less than 1% shallow and retained. So, it
looks like maybe my plugin is messing with some caches, or causing some
other classes to retain references. Are there any pitfalls for memory
leaks that I might not be aware of?

com.intellij.psi holds 15MB shallow size, 64MB retained size.
com.intellij.openapi holds 7MB, 36MB (mostly from vfs package). Is this
sound normal?

Unfortunately I won't submit this memory snapshot because it contains
confidential information in the form of classnames. I don't know if it's
my plugin's problem or IDEA bug. I hope someone can help me work out the
problem.

4 comments

Look for how may Projects are retained, what make them reachanble

Keith Lea wrote:

For one of our internal plugins, some users report severe memory
problems, like 400MB memory usage and >1min lockups. I got some memory
dumps and it looks like things are normal.

The plugin provides CompletionData, ReferenceProvider, and inspections
with a few quickfixes. These are all used only for XML files.

First of all, the user said his memory meter showed 400MB+ usage, but YK
shows retained size as 112MB. What does this mean?

Second, my plugin classes are less than 1% shallow and retained. So, it
looks like maybe my plugin is messing with some caches, or causing some
other classes to retain references. Are there any pitfalls for memory
leaks that I might not be aware of?

com.intellij.psi holds 15MB shallow size, 64MB retained size.
com.intellij.openapi holds 7MB, 36MB (mostly from vfs package). Is this
sound normal?

Unfortunately I won't submit this memory snapshot because it contains
confidential information in the form of classnames. I don't know if it's
my plugin's problem or IDEA bug. I hope someone can help me work out the
problem.



--
Best regards,
Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0

It looks like 2 ProjectImpl are retained, from totally normal sources.
None of my plugin classes are in the paths to GC roots. Also, the memory
problem happens even when only one project has been opened throughout
the IDEA session. Do you have other ideas?

Maxim Mossienko (JetBrains) wrote:

Look for how may Projects are retained, what make them reachanble

Keith Lea wrote:

>> For one of our internal plugins, some users report severe memory
>> problems, like 400MB memory usage and >1min lockups. I got some memory
>> dumps and it looks like things are normal.
>>
>> The plugin provides CompletionData, ReferenceProvider, and inspections
>> with a few quickfixes. These are all used only for XML files.
>>
>> First of all, the user said his memory meter showed 400MB+ usage, but
>> YK shows retained size as 112MB. What does this mean?
>>
>> Second, my plugin classes are less than 1% shallow and retained. So,
>> it looks like maybe my plugin is messing with some caches, or causing
>> some other classes to retain references. Are there any pitfalls for
>> memory leaks that I might not be aware of?
>>
>> com.intellij.psi holds 15MB shallow size, 64MB retained size.
>> com.intellij.openapi holds 7MB, 36MB (mostly from vfs package). Is
>> this sound normal?
>>
>> Unfortunately I won't submit this memory snapshot because it contains
>> confidential information in the form of classnames. I don't know if
>> it's my plugin's problem or IDEA bug. I hope someone can help me work
>> out the problem.


0

Hello Keith,

YK normally doesn't count memory reachable from soft references only and
doesn't count garbage of course.
So 112MB snapshot means memory indicator will indeed jump to 112MB after
some clicking on GC button.

-


Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

For one of our internal plugins, some users report severe memory
problems, like 400MB memory usage and >1min lockups. I got some memory
dumps and it looks like things are normal.

The plugin provides CompletionData, ReferenceProvider, and inspections
with a few quickfixes. These are all used only for XML files.

First of all, the user said his memory meter showed 400MB+ usage, but
YK shows retained size as 112MB. What does this mean?

Second, my plugin classes are less than 1% shallow and retained. So,
it looks like maybe my plugin is messing with some caches, or causing
some other classes to retain references. Are there any pitfalls for
memory leaks that I might not be aware of?

com.intellij.psi holds 15MB shallow size, 64MB retained size.
com.intellij.openapi holds 7MB, 36MB (mostly from vfs package). Is
this sound normal?

Unfortunately I won't submit this memory snapshot because it contains
confidential information in the form of classnames. I don't know if
it's my plugin's problem or IDEA bug. I hope someone can help me work
out the problem.



0

Thanks for your help Maxim and Maxim. I'm working on tracking it down
and it's looking good.

Maxim Shafirov (JetBrains) wrote:

Hello Keith,

YK normally doesn't count memory reachable from soft references only and
doesn't count garbage of course.
So 112MB snapshot means memory indicator will indeed jump to 112MB after
some clicking on GC button.

------------------
Maxim Shafirov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>> For one of our internal plugins, some users report severe memory
>> problems, like 400MB memory usage and >1min lockups. I got some memory
>> dumps and it looks like things are normal.
>>
>> The plugin provides CompletionData, ReferenceProvider, and inspections
>> with a few quickfixes. These are all used only for XML files.
>>
>> First of all, the user said his memory meter showed 400MB+ usage, but
>> YK shows retained size as 112MB. What does this mean?
>>
>> Second, my plugin classes are less than 1% shallow and retained. So,
>> it looks like maybe my plugin is messing with some caches, or causing
>> some other classes to retain references. Are there any pitfalls for
>> memory leaks that I might not be aware of?
>>
>> com.intellij.psi holds 15MB shallow size, 64MB retained size.
>> com.intellij.openapi holds 7MB, 36MB (mostly from vfs package). Is
>> this sound normal?
>>
>> Unfortunately I won't submit this memory snapshot because it contains
>> confidential information in the form of classnames. I don't know if
>> it's my plugin's problem or IDEA bug. I hope someone can help me work
>> out the problem.
>>


0

Please sign in to leave a comment.