paypal/heap-dump-tool

How to filter Thread Dump in sanitization?

Opened this issue · 3 comments

zouyx commented

I want to still appearing thread name in Thread Dump block after i run this tool, But now all of thread names are sanitized as below.
Has any idea for retain them?
Thanks for your help.
image

zouyx commented

@maxxedev Hi, Max, do you have any idea for fix it? You can tell me your thinking or idea, i can help you to fix it

Basically the tool needs to keep track of all the threads and their thread name fields. Something like:

  • scan the heap dump for java.lang.Thread object ids, keep track of the thread name object ids
  • scan the heap dump for java.lang.String objects. keep track of strings that match thread name object ids
  • when sanitizing strings, skip if the string object id matches one of thread name object ids.

It's doable but a bit complicated.

 
Another option is to simply capture a thread dump (e.g. with jstack, jcmd) when capturing a heap dump. Not quite the same as the threads in heap dump but should be accurate enough. In fact, if you run the tool with docker option as mentioned in README, the tool will create both thread dump and heap dump files

zouyx commented

Hi Max, thanks for your reply.
Actually, I have though about use jstack or jcmd for capture a thread dump, there is suitable for normal scence.
But not suitable for exception scene , such as can not suitable for OOM.