Export to hprof format?
-
- Posts: 11
- Joined: Thu May 09, 2013 6:57 am
Export to hprof format?
Is there anyway to export/convert the memory snapshot into hprof format so that I can open it in Eclipse MAT tool? I am currently looking at a memory snapshot and have the need to run some OQL queries. Thank you!
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
There is no way to convert, but you can capture snapshot in HPROF format:
http://www.yourkit.com/docs/java/help/h ... pshots.jsp
[EDIT: The converter was added in v2014.]
http://www.yourkit.com/docs/java/help/h ... pshots.jsp
[EDIT: The converter was added in v2014.]
-
- Posts: 11
- Joined: Thu May 09, 2013 6:57 am
Re: Export to hprof format?
Thanks Antony for the response, I am aware of that option. Could this be added as a feature request?
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
Yes, we can add a request, but I cannot promise it will be of a high priority.
Perhaps the profiler is already able to provide the requested information but you didn't notice corresponding feature, or we should consider adding a new feature if we find it useful to other users too.
What are you looking for in particular? Could you please provide detail.have the need to run some OQL queries.
Perhaps the profiler is already able to provide the requested information but you didn't notice corresponding feature, or we should consider adding a new feature if we find it useful to other users too.
-
- Posts: 11
- Joined: Thu May 09, 2013 6:57 am
Re: Export to hprof format?
Right now, I just want to get all the String's that are referred by certain type and export them to a file, something like this:
select toString(o.rawObject) from a.b.c o
where o.rawObject is a String. Is this possible in YourKit?
In general, OQL is quite powerful, so I can see having other requirements in the future that may not be possible within YourKit. Also, I find that the YourKit interface is quite limiting (e.g., the object explorer on large arrays).
select toString(o.rawObject) from a.b.c o
where o.rawObject is a String. Is this possible in YourKit?
In general, OQL is quite powerful, so I can see having other requirements in the future that may not be possible within YourKit. Also, I find that the YourKit interface is quite limiting (e.g., the object explorer on large arrays).
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
YourKit has the object set description feature:
http://www.yourkit.com/docs/java/help/language.jsp
It seems this one is what you need:
http://www.yourkit.com/docs/java/help/language.jsp
It seems this one is what you need:
Code: Select all
<reachable-objects>
<from>
<objects class="a.b.c"/>
</from>
<object-filter>
<objects class="java.lang.String"/>
</object-filter>
<field-filter>
<class name="a.b.c">
<allowed field="rawObject"/>
</class>
</field-filter>
</reachable-objects>
-
- Posts: 11
- Joined: Thu May 09, 2013 6:57 am
Re: Export to hprof format?
Thanks, but where do I stick in the custom XML? When I open Settings -> Sets of Objects, I don't see an option to create a new set.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
Hm, it's gone. Must be a bug. We'll fix it ASAP.
As a workaround please click one of existing sets and replace the description with the xml I've provided.
As a workaround please click one of existing sets and replace the description with the xml I've provided.
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
Double click.please click
-
- Posts: 11
- Joined: Thu May 09, 2013 6:57 am
Re: Export to hprof format?
Worked for this specific use case, but it is clunky! Besides, OQL has many features such as the ability to call methods, select items in an array and use subselects, so you should either add this feature yourself, or allow exporting to hprof (after all, it is a JVM standard, and there could be other reasons why a user would want to do this).
-
- Posts: 6172
- Joined: Wed Aug 11, 2004 8:37 am
Re: Export to hprof format?
The converter was added in v2014.