Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Heap Dumps larger than 2GB fail with "Unexpected top-level record type" exception #10

Open
gerossie opened this issue May 30, 2014 · 3 comments

Comments

@gerossie
Copy link

First of all, thanks for providing this great tool. It provides a great base for custom HPROF parsing. I have run into one small issue though. In HprofParser.parseRecord(), if the HPROF is larger than 2GB (from a 64 bit JVM for example), calling

int bytesLeft = in.readInt();

to get the size of the heap dump (tag is 0xc) results in a negative number. This throws off the rest of the parsing and causes an "Unexpected top-level record type" exception (for me at least). I modified the code and changed the above to

long bytesLeft = in.readInt() & 0xFFFFFFFFL;

And modified a few other spots in the code. It's now working for me with heap dumps larger than 2GB.

Again, thanks for the great tool. If you could incorporate this change, along with any other changes you think would be required to support 64 bit HPROF files, I think it would greatly improve the usability of this tool.

@eaftan
Copy link
Owner

eaftan commented May 30, 2014

Thanks for reporting this! If you send me a pull request with your change, I'm happy to merge it. I never did test with very large heap dumps.

@gerossie
Copy link
Author

I tried following the steps outlined here to create a pull request

https://help.github.com/articles/creating-a-pull-request

But I am unable to push the changes, I get "Authentication failed"

@gerossie
Copy link
Author

Sorry, the error is

error: The requested URL returned error: 403 Forbidden while accessing https://github.com/eaftan/hprof-parser.git/info/refs

bogdad added a commit to bogdad/hprof-parser that referenced this issue Dec 23, 2014
eaftan added a commit that referenced this issue Oct 10, 2018
Changed bytesLeft to long, per #10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants