Profile Image
Dileep

Need to verify ThreadLocals in tdump

Hi , I would like to verify my threadlocal values. can i verify the values in tdump? or in heapdump? 
I can verify it by logging info in java,but i want to double verify it in tdump or heapdump,

Reason is I want to verify my threadcontext of a thread

 

Report URL - https://fastthread.io/my-thread-report.jsp?p=c2hhcmVkLzIwMjEvMTIvMS8tLXRocmVhZC50ZHVtcC0tMTAtMjItMTc=

  • threadcontext

Please Sign In or to post your comment or answer

Profile Image

sainath

Hello Dileep Kumar,

 

I think you need to verify in the heap dump, not in the thread dump since the thread dump contains the stack traces of threads. 

Profile Image

Dileep

Hi Sainath,

Thanks for your reply. Can you guide me on how to check thread context values in a heap dump?

Profile Image

Mahesh

Hi Dileep,

 

If I have understood your question correctly, you want to see threadLocal's in the thread dump. But I don't think we get threadLocal values in the thread dump file.

Profile Image

Dileep

Hi Mahesh,

Thanks for your reply. Can you provide an alternative way of how to verify my thread locals (threadcontext) , I can verify them programmatically but I want to cross-verify it too.

Profile Image

Mahesh

Hi Dileep,

 

I think you can capture heap dump from your application and upload your heap dump to the HeapHero tool. This tool will analyze your heap dump and display report. In the report, go to the What's in your Memory (by class)? section. Please check the attached screenshot for your reference -



In this section, you should see one entry with the class name java.lang.ThreadLocal$ThreadLocalMap. When you click on this class name, it will take you to another page where you should be able to see all your ThreadLocal variables.

 

To learn about how to capture a heap dump, visit https://dzone.com/articles/how-to-capture-java-heap-dumps-7-options

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • threadcontext