shadowfly256 opened a new issue, #8079:
URL: https://github.com/apache/netbeans/issues/8079

   ### Apache NetBeans version
   
   Apache NetBeans 24
   
   ### What happened
   
   I switched my monitor off to preserve some power while idling. My CPU 
started getting hot immediately. I looked at my TaskManager and found NetBeans 
using one CPU core at 100%.
   
   I then used VisualVM to profile NetBeans to see if it's "easy" to fix, and 
the terminal output of VisualVM filled with exceptions like this:
   
   ```
   java.lang.IllegalArgumentException: Width (0) and height (0) cannot be <= 0
        at 
java.desktop/sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:75)
        at 
java.desktop/sun.awt.image.SunVolatileImage.<init>(SunVolatileImage.java:122)
        at 
java.desktop/java.awt.GraphicsConfiguration.createCompatibleVolatileImage(GraphicsConfiguration.java:305)
        at 
java.desktop/java.awt.GraphicsConfiguration.createCompatibleVolatileImage(GraphicsConfiguration.java:239)
        at 
java.desktop/javax.swing.RepaintManager.getVolatileOffscreenBuffer(RepaintManager.java:1111)
        at 
java.desktop/javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1556)
        at 
java.desktop/javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:271)
        at 
java.desktop/javax.swing.RepaintManager.paint(RepaintManager.java:1336)
        at 
java.desktop/javax.swing.JComponent._paintImmediately(JComponent.java:5266)
        at 
java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5076)
        at 
java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5057)
        at java.desktop/javax.swing.JLayer.paintImmediately(JLayer.java:431)
        at 
java.desktop/javax.swing.plaf.LayerUI.paintImmediately(LayerUI.java:728)
        at java.desktop/javax.swing.JLayer.paintImmediately(JLayer.java:426)
        at 
java.desktop/javax.swing.JComponent.paintImmediately(JComponent.java:5057)
        at 
java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:878)
        at 
java.desktop/javax.swing.RepaintManager$4.run(RepaintManager.java:861)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at 
java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:861)
        at 
java.desktop/javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:834)
        at 
java.desktop/javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:784)
        at 
java.desktop/javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1897)
        at 
java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
        at 
java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
        at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
        at 
java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
        at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
        at 
org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
   [catch] at 
java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
        at 
java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
        at 
java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
   ```
   
   Then i realized that both NetBeans and VisualVM's GUIs were glitching:
   
![Screenshot_20241220_170149](https://github.com/user-attachments/assets/64a12613-de5a-4122-b864-0d59f681709f)
   So i closed NetBeans, and switched off my screen. My CPU shot to 100% again. 
So yes, **this bug is not NetBeans exclusive**.
   Without NetBeans or VisualVM my CPU remains cool.
   
   Then i tried a simple Java GUI program, as i thought this might be a Java 
bug. But no, a simple Java JFrame does not create problems.
   This is the reason why i did not report this to OpenJDK.
   
   I hope this is not the wrong place for this bug. Maybe this should be an 
OpenJDK bug, but i am sure you can tell me.
   
   Thanks for the awesome FOSS IDE by the way.
   
   ### Language / Project Type / NetBeans Component
   
   Java Ant application
   
   ### How to reproduce
   
   1. Get a clean NetBeans install
   2. Start NetBeans
   3. Turn your monitor off (with a physical button)
   4. Observe no CPU load
   5. Create a new Ant application
   6. Turn your monitor off
   7. Observe high CPU load, and NetBeans reporting exception
   8. Close Ant project
   9. Close NetBeans
   10. Start NetBeans
   11. Turn your monitor off
   12. Observe no CPU load
   
   ### Did this work correctly in an earlier version?
   
   No / Don't know
   
   ### Operating System
   
   Gentoo Linux 2.17 KDE Plasma Version: 6.2.4 Kernel Version: 6.6.62-gentoo
   
   ### JDK
   
   Gentoo host: openjdk 17.0.13 2024-10-15 >> NetBeans Flatpak: jdk21
   
   ### Apache NetBeans packaging
   
   Other
   
   ### Anything else
   
   NetBeans package: Flatpak -  org.apache.netbeans//24
   
   Reproducable: Always
   
   VisualVM "source of load":
   
![Screenshot_20241220_170241](https://github.com/user-attachments/assets/967bad9c-9a8b-472e-8f82-39280bfa56df)
   
   ### Are you willing to submit a pull request?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to