Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361516 - Error: Snapshot contains multiple instances of java.lang.ref.Finalizer$FinalizerThread class
Summary: Error: Snapshot contains multiple instances of java.lang.ref.Finalizer$Finali...
Status: RESOLVED FIXED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: Other other
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andrew Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-20 06:06 EDT by evantill CLA
Modified: 2011-10-21 08:23 EDT (History)
1 user (show)

See Also:


Attachments
heap dump to reproduce the bug (9.67 MB, application/octet-stream)
2011-10-20 06:49 EDT, evantill CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description evantill CLA 2011-10-20 06:06:29 EDT
Build Identifier: Eclipse Memory Analyzer - RCP feature  Version: 1.1.1.201108240735 Build id: 1.1.1

on HPUX JVM it is possible to have more than one Finalizer Thread.
To enable multi Finalizer Threads we are using the jvm option -Djava.finalizer.threadCount=5 where "5" is the number of finalizer threads.

When having more than one finalizer thread MAT, "Finalizer Overview" does not work any more.

The exception is :
Error: Snapshot contains multiple instances of java.lang.ref.Finalizer$FinalizerThread class. (java.lang.Exception)

java.lang.Exception: Error: Snapshot contains multiple instances of java.lang.ref.Finalizer$FinalizerThread class.
at org.eclipse.mat.inspections.finalizer.FinalizerThreadQuery.getFinalizerThreads1(FinalizerThreadQuery.java:80)
at org.eclipse.mat.inspections.finalizer.FinalizerThreadQuery.getFinalizerThreads(FinalizerThreadQuery.java:57)
at org.eclipse.mat.inspections.finalizer.FinalizerInProcessingQuery.execute(FinalizerInProcessingQuery.java:68)
at org.eclipse.mat.query.registry.ArgumentSet.execute(ArgumentSet.java:129)
at org.eclipse.mat.snapshot.query.SnapshotQuery.execute(SnapshotQuery.java:192)
at org.eclipse.mat.inspections.finalizer.FinalizerQuery.execute(FinalizerQuery.java:38)
at org.eclipse.mat.query.registry.ArgumentSet.execute(ArgumentSet.java:129)
at org.eclipse.mat.ui.QueryExecution$ExecutionJob.run(QueryExecution.java:174)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Reproducible: Always

Steps to Reproduce:
1. Generate a HeapDump on HPUX where the java process was running with the option -Djava.finalizer.threadCount=5
2. Open the HeapDump in MAT
3. Go to Java Basics -> Finalizer Overview
Comment 1 Andrew Johnson CLA 2011-10-20 06:35:59 EDT
The fix is probably just to remove that check - the code does cope with multiple threads.
Comment 2 evantill CLA 2011-10-20 06:49:16 EDT
Created attachment 205605 [details]
heap dump to reproduce the bug
Comment 3 Andrew Johnson CLA 2011-10-20 12:10:30 EDT
First fix is to remove the check for exactly one finalizer thread.
I'll also display the threads using the thread_overview query.
Comment 4 Andrew Johnson CLA 2011-10-21 03:17:13 EDT
Fix is now available in snapshot builds.
Comment 5 evantill CLA 2011-10-21 08:23:38 EDT
I will test it next thursday and give you some feed back. Thank you.