Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the Java2D Disposer Thread?

Tags:

java

I have created a sample java application working with Hibernate, when I doing the thread-dump I observe the strange thread called Java2D Disposer.

Can someone tell me the function of that thread?

like image 604
Marco Avatar asked Feb 04 '11 11:02

Marco


1 Answers

Certain entities in the AWT system need finalization to free resources. The most prominent example is java.awt.Windows which needs to dispose its native resources after the window is garbage collected.

One could do this with finalizers, but a solution that gives you more detailed control is to use phantom references with a reference queue. That solution needs a dedicated thread which waits on the reference queue. That thread is the "Java 2D disposer" thread, It is created when you initialize the AWT system.

like image 150
Ingo Kegel Avatar answered Sep 28 '22 08:09

Ingo Kegel