IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Agents de placement/Fenêtres Java Discussion :

AWT-EventQueue-0 reste en mode "running" à la fermeture d'une JDialog


Sujet :

Agents de placement/Fenêtres Java

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Février 2010
    Messages : 4
    Par défaut AWT-EventQueue-0 reste en mode "running" à la fermeture d'une JDialog
    Hello,

    Voici mon petit soucis :

    J'appelle une fenêtre JDialog, et lors de sa fermeture, le thread AWT-EventQueue ne se remet plus en "waiting" et du coup me mange toutes mes ressources CPU.

    Lorsque je quitte la fenêtre, j'appelle la fonction dispose(). le paramètre d'appel de celle-ci pour le modal est true, afin que la fenêtre soit bloquante.

    Comment puis-je remettre AWT-EventQueue en waiting ?

    Merci d'avance...

    Seb

  2. #2
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    si ta queue n'est pas en waiting, c'est qu'elle fait quelque chose, la question est "quoi". Si t'es dans un IDE, en mode debug, met l'applicaiton en pause, repere le thread de levent queue et regarde ou il se trouve dans sa stack, ca te donnera une idée. Si tu lance ton application en ligne de commande, dans la console qui a servis à lancer java, tappe ctrl-Z (pour windows seulement), ca devrais déclencher un ThreadDump et copie le sur le forum.

    Si t'es sous linux, on a l'équivalent en envoyant le signal 3 à la JVM (kill 3 <pid java>)

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Février 2010
    Messages : 4
    Par défaut
    Voilà le dump après avoir ouvert ma fenêtre puis refermée.
    2010-02-03 16:44:53
    Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):

    "TimerQueue" daemon prio=6 tid=0x02faa400 nid=0x1534 in Object.wait() [0x0352f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22f7cb90> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(Unknown Source)
    - locked <0x22f7cb90> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Unknown Source)

    "DestroyJavaVM" prio=6 tid=0x003b6400 nid=0x640 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "AWT-EventQueue-0" prio=6 tid=0x02c4fc00 nid=0x654 runnable [0x032df000]
    java.lang.Thread.State: RUNNABLE
    at java.lang.Object.hashCode(Native Method)
    at java.util.HashMap.get(Unknown Source)
    at sun.awt.AppContext.get(Unknown Source)
    - locked <0x22e97ee0> (a java.util.HashMap)
    at java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(Unknown Source)
    - locked <0x2b7a0e50> (a java.lang.Class for java.awt.KeyboardFocusManager)
    at java.awt.KeyboardFocusManager.getCurrentKeyboardFocusManager(Unknown Source)
    at java.awt.Component.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at javax.swing.JRootPane.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window.removeNotify(Unknown Source)
    - locked <0x22e914d8> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window$1DisposeAction.run(Unknown Source)
    at java.awt.Window.doDispose(Unknown Source)
    at java.awt.Dialog.doDispose(Unknown Source)
    at java.awt.Window.dispose(Unknown Source)
    at ch.mypackage.packutil.PackUtilMessageGenerator.formWindowClosed(PackUtilMessageGenerator.java:903)
    at ch.mypackage.packutil.PackUtilMessageGenerator.access$000(PackUtilMessageGenerator.java:44)
    at ch.mypackage.packutil.PackUtilMessageGenerator$1.windowClosed(PackUtilMessageGenerator.java:154)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JDialog.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

    "AWT-Windows" daemon prio=6 tid=0x02c4e400 nid=0x11b4 runnable [0x0324f000]
    java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    "AWT-Shutdown" prio=6 tid=0x02c38c00 nid=0xa58 in Object.wait() [0x031ff000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8e930> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at sun.awt.AWTAutoShutdown.run(Unknown Source)
    - locked <0x22e8e930> (a java.lang.Object)
    at java.lang.Thread.run(Unknown Source)

    "Java2D Disposer" daemon prio=10 tid=0x02c37c00 nid=0x106c in Object.wait() [0x031af000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8e9c0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x22e8e9c0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at sun.java2d.Disposer.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    "Low Memory Detector" daemon prio=6 tid=0x02bb8800 nid=0x11fc runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "CompilerThread0" daemon prio=10 tid=0x02bb2800 nid=0x3b0 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Attach Listener" daemon prio=10 tid=0x02bb1000 nid=0xb28 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Signal Dispatcher" daemon prio=10 tid=0x02bafc00 nid=0x12a4 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Finalizer" daemon prio=8 tid=0x02b6dc00 nid=0x2f8 in Object.wait() [0x02d3f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8ebf0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x22e8ebf0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

    "Reference Handler" daemon prio=10 tid=0x02b6c800 nid=0xdf8 in Object.wait() [0x02cef000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8e748> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    - locked <0x22e8e748> (a java.lang.ref.Reference$Lock)

    "VM Thread" prio=10 tid=0x02b6ac00 nid=0xbcc runnable

    "VM Periodic Task Thread" prio=10 tid=0x02bbac00 nid=0x1068 waiting on condition

    JNI global references: 1236

    Heap
    def new generation total 960K, used 618K [0x22990000, 0x22a90000, 0x22e70000)
    eden space 896K, 68% used [0x22990000, 0x22a2a868, 0x22a70000)
    from space 64K, 0% used [0x22a80000, 0x22a800d0, 0x22a90000)
    to space 64K, 0% used [0x22a70000, 0x22a70000, 0x22a80000)
    tenured generation total 10560K, used 7594K [0x22e70000, 0x238c0000, 0x26990000)
    the space 10560K, 71% used [0x22e70000, 0x235da8e8, 0x235daa00, 0x238c0000)
    compacting perm gen total 12288K, used 2706K [0x26990000, 0x27590000, 0x2a990000)
    the space 12288K, 22% used [0x26990000, 0x26c34bb8, 0x26c34c00, 0x27590000)
    ro space 8192K, 63% used [0x2a990000, 0x2aea8b20, 0x2aea8c00, 0x2b190000)
    rw space 12288K, 53% used [0x2b190000, 0x2b805138, 0x2b805200, 0x2bd90000)

  4. #4
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    un peux rapide tu peux le faire une ou deux minutes après le close? Là il est toujours occupé de faire le dispose...

  5. #5
    Futur Membre du Club
    Profil pro
    Inscrit en
    Février 2010
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : Suisse

    Informations forums :
    Inscription : Février 2010
    Messages : 4
    Par défaut
    Hopla, voici un nouveau dump après quelques minutes de ventilo à plein tube du pc (et de la fermeture de la fenêtre) :

    2010-02-04 14:33:36
    Full thread dump Java HotSpot(TM) Client VM (14.3-b01 mixed mode, sharing):

    "TimerQueue" daemon prio=6 tid=0x02f97800 nid=0x157c in Object.wait() [0x0352f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22f7cba0> (a javax.swing.TimerQueue)
    at javax.swing.TimerQueue.run(Unknown Source)
    - locked <0x22f7cba0> (a javax.swing.TimerQueue)
    at java.lang.Thread.run(Unknown Source)

    "DestroyJavaVM" prio=6 tid=0x003b6400 nid=0x1288 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "AWT-EventQueue-0" prio=6 tid=0x02f39400 nid=0x904 runnable [0x032df000]
    java.lang.Thread.State: RUNNABLE
    at java.awt.KeyboardFocusManager.clearMostRecentFocusOwner(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at java.awt.Component.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at javax.swing.AbstractButton.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at javax.swing.JComponent.removeNotify(Unknown Source)
    at javax.swing.JRootPane.removeNotify(Unknown Source)
    at java.awt.Container.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window.removeNotify(Unknown Source)
    - locked <0x22e916d8> (a java.awt.Component$AWTTreeLock)
    at java.awt.Window$1DisposeAction.run(Unknown Source)
    at java.awt.Window.doDispose(Unknown Source)
    at java.awt.Dialog.doDispose(Unknown Source)
    at java.awt.Window.dispose(Unknown Source)
    at ch.package.mypack.MypackMessageGenerator.formWindowClosed(MypackMessageGenerator.java:903)
    at ch.package.mypack.MypackMessageGenerator.access$000(MypackMessageGenerator.java:44)
    at ch.package.mypack.MypackMessageGenerator$1.windowClosed(MypackMessageGenerator.java:154)
    at java.awt.Window.processWindowEvent(Unknown Source)
    at javax.swing.JDialog.processWindowEvent(Unknown Source)
    at java.awt.Window.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)

    "AWT-Windows" daemon prio=6 tid=0x02c4e400 nid=0x85c runnable [0x0324f000]
    java.lang.Thread.State: RUNNABLE
    at sun.awt.windows.WToolkit.eventLoop(Native Method)
    at sun.awt.windows.WToolkit.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    "AWT-Shutdown" prio=6 tid=0x02c38c00 nid=0x15b0 in Object.wait() [0x031ff000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8eb30> (a java.lang.Object)
    at java.lang.Object.wait(Object.java:485)
    at sun.awt.AWTAutoShutdown.run(Unknown Source)
    - locked <0x22e8eb30> (a java.lang.Object)
    at java.lang.Thread.run(Unknown Source)

    "Java2D Disposer" daemon prio=10 tid=0x02c37c00 nid=0x21c in Object.wait() [0x031af000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8ebc0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x22e8ebc0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at sun.java2d.Disposer.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

    "Low Memory Detector" daemon prio=6 tid=0x02bb8800 nid=0x14c0 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "CompilerThread0" daemon prio=10 tid=0x02bb2800 nid=0x360 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Attach Listener" daemon prio=10 tid=0x02bb1000 nid=0x9c4 runnable [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Signal Dispatcher" daemon prio=10 tid=0x02bafc00 nid=0xcd4 waiting on condition [0x00000000]
    java.lang.Thread.State: RUNNABLE

    "Finalizer" daemon prio=8 tid=0x02b6dc00 nid=0x161c in Object.wait() [0x02d3f000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8edf0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    - locked <0x22e8edf0> (a java.lang.ref.ReferenceQueue$Lock)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source)

    "Reference Handler" daemon prio=10 tid=0x02b6c800 nid=0xb74 in Object.wait() [0x02cef000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    - waiting on <0x22e8e948> (a java.lang.ref.Reference$Lock)
    at java.lang.Object.wait(Object.java:485)
    at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source)
    - locked <0x22e8e948> (a java.lang.ref.Reference$Lock)

    "VM Thread" prio=10 tid=0x02b6ac00 nid=0xd24 runnable

    "VM Periodic Task Thread" prio=10 tid=0x02bbac00 nid=0x11f0 waiting on condition

    JNI global references: 1105

    Heap
    def new generation total 960K, used 730K [0x22990000, 0x22a90000, 0x22e70000)
    eden space 896K, 81% used [0x22990000, 0x22a469d8, 0x22a70000)
    from space 64K, 0% used [0x22a80000, 0x22a800d0, 0x22a90000)
    to space 64K, 0% used [0x22a70000, 0x22a70000, 0x22a80000)
    tenured generation total 10408K, used 8933K [0x22e70000, 0x2389a000, 0x26990000)
    the space 10408K, 85% used [0x22e70000, 0x237295e8, 0x23729600, 0x2389a000)
    compacting perm gen total 12288K, used 2733K [0x26990000, 0x27590000, 0x2a990000)
    the space 12288K, 22% used [0x26990000, 0x26c3b6f0, 0x26c3b800, 0x27590000)
    ro space 8192K, 63% used [0x2a990000, 0x2aea8b20, 0x2aea8c00, 0x2b190000)
    rw space 12288K, 53% used [0x2b190000, 0x2b805138, 0x2b805200, 0x2bd90000)

  6. #6
    Expert éminent
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 482
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 482
    Par défaut
    est-ce que tu aurais pas un event qui tourne en boucle? Genre tu réagis au close de la fenetre en faisant un dispose qui déclenche un close qui déclenche un dispose, etc? Met des System.out.println dans tes event liés à la fermutre, afin de voir si il y en a pas un qui est appelé comme un fou....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 8
    Dernier message: 11/05/2006, 19h32
  2. [JDIC]Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
    Par kedare dans le forum Concurrence et multi-thread
    Réponses: 4
    Dernier message: 06/05/2006, 22h45
  3. [MySQL] Recherche FULL TEXT IN BOOLEAN MODE et les Quotes
    Par GarGamel55 dans le forum PHP & Base de données
    Réponses: 10
    Dernier message: 23/01/2006, 20h01

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo