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

How to filter Thread Dump in sanitization? #5

Open
zouyx opened this issue Jul 22, 2022 · 3 comments
Open

How to filter Thread Dump in sanitization? #5

zouyx opened this issue Jul 22, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@zouyx
Copy link

zouyx commented Jul 22, 2022

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

@maxxedev maxxedev added the enhancement New feature or request label Jul 24, 2022
@zouyx
Copy link
Author

zouyx commented Oct 19, 2022

@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

@maxxedev
Copy link
Collaborator

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
Copy link
Author

zouyx commented Oct 21, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants