Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361516

Summary: Error: Snapshot contains multiple instances of java.lang.ref.Finalizer$FinalizerThread class
Product: [Tools] MAT Reporter: evantill <eric.vantillard>
Component: CoreAssignee: Andrew Johnson <andrew_johnson>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eric.vantillard
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   
Whiteboard:
Attachments:
Description Flags
heap dump to reproduce the bug none

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.