0

I have a Java application (Kafka Streams app) where a few ConcurrentSkipListMap objects are maintained (in InMemoryWindowStore). The type of the key of the maps is org.apache.kafka.common.utils.Bytes and the values are byte[]. The byte arrays are serialized Protocol Buffers objects.

I have taken a heap dump of this app for investigating an issue and I want to extract the byte arrays stored as the values of the maps, deserialize those byte arrays into Protocol Buffers objects and inspect them. Those maps contain 3 million mappings (based on what I see on Eclipse Memory Analyzer). Is there a good way to somehow extract those raw byte arrays in the maps in the heap dump?

1 Answer 1

1

Select the byte array, then use Copy > Save Value to File.

Sign up to request clarification or add additional context in comments.

3 Comments

Unfortunately that doesn't work for my usecase, because non-ascii parts get converted into ..
It should have worked for a single byte[] array, as the help says: Save to a file the value of char[], String, StringBuffer or StringBuilder into a text file, or for a single primitive array store the elements as binary, or for other types, the printable value or the class name and address. but perhaps there is a bug in git.eclipse.org/c/mat/org.eclipse.mat.git/tree/plugins/…
Thank you pointing that out, actually it seems to work with just single entry (it doesn't convert them into .) but not for multiple entries (the . conversion kicks in in that case). Now the question is how do I do this for 3 million entries.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.