Community
Participate
Working Groups
GZIP compressed HPROF files are read with special streams to handle seeking in a non-seekable format. The chucked reader ChunkedGZIPRandomAccessFile works quite well as the state is reset every 1MB, so not much reading needs to be done. Regular GZIP HPROF files created by users with gzip or by older versoin of MAT use the SeekableStream which has various cached readers, and where it finds the immediately preceding reader, clones it, then reads forward to the required position. The underlying GZIPinputStream2 is quite big as it has an InflaterInputStream with a 32K dictionary, 257 byte output buffer and 16KB input buffer. We could improve the performance a little by using the dictionary as a cache. It holds the last 32K of output, so could also be used for a mark() / reset() cache. We can also merge the output buffer into the dictionary. GZIPInputStream2 then needs some code to handle mark and reset so that the CRC calculation is still correct. The best thing is to ignore bytes read after a reset from the mark point back to the farthest reset point, that way the CRC does not need to be cloned and a skip of this region doesn't need to recalculate the CRC. SeekableStream then needs some small changes to handle mark / reset, so marking regularly and just before the end of a long skip, and doing a reset before putting the PosStream back in the cache. This is all conditional on markSupported in InflaterInputStream This can be tested by the Acquire Heap Dumps and Export HPROF tests which can export in chunked and unchunked compressed format.
New Gerrit change created: https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/180542
Gerrit change https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/180542 was merged to [master]. Commit: http://git.eclipse.org/c/mat/org.eclipse.mat.git/commit/?id=c190072e03364b07d9e1309acbe749949066e221
New Gerrit change created: https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/180603
Gerrit change https://git.eclipse.org/r/c/mat/org.eclipse.mat/+/180603 was merged to [master]. Commit: http://git.eclipse.org/c/mat/org.eclipse.mat.git/commit/?id=db76c83775be4bf93d6616d27931a60ad4fb2829
This is now complete.