Reputation: 1
In Swing application, some UI operation events gets lags in execution and UI and gets freeze for few seconds. when tried to check using
ThreadInfo MonitorInfo[] monitors = threadInfo.getLockedMonitors();
and
StackTraceElement[] stackElements = threadInfo.getStackTrace();
displays and the lines continuous.. to the component.
This happens only in webstart
ex:
**HOLDS MONITORS:** [java.util.zip.ZStreamRef@a4f0208,
com.sun.deploy.cache.CacheEntry@2788c4ea,
com.sun.deploy.cache.CachedJarFile@294f3e6b,
com.sun.jnlp.JNLPClassLoader@5ce11cce,
javax.swing.plaf.basic.DefaultMenuLayout@d096bf8,
java.awt.Component$AWTTreeLock@285a2772]
STACK TRACE:
java.util.zip.Inflater.inflateBytes(Native Method)
java.util.zip.Inflater.inflate(Unknown Source)
java.util.zip.InflaterInputStream.read(Unknown Source)
java.util.jar.JarVerifier$VerifierStream.read(Unknown Source)
com.sun.deploy.security.JarVerifier.readAndMaybeSaveStreamTo(Unknown
Source)
com.sun.deploy.security.JarVerifier.authenticateJarEntry(Unknown Source)
com.sun.deploy.security.EnhancedJarVerifier.validate(Unknown Source)
com.sun.deploy.cache.CacheEntry$3.run(Unknown Source)
com.sun.deploy.cache.CacheEntry$3.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
com.sun.deploy.cache.CacheEntry.getJarSigningData(Unknown Source)
com.sun.deploy.cache.CachedJarFile.getSigningData(Unknown Source)
com.sun.deploy.cache.CachedJarFile$JarFileEntry.getCodeSigners(Unknown
Source)
com.sun.deploy.security.DeployURLClassPath$JarLoader$2.getCodeSigners(
Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
com.sun.jnlp.JNLPClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
Upvotes: 0
Views: 133
Reputation: 385
Have you tried putting the calls to those methods in separate threads? Because you use Swing, it's mostly thread safe. Is it the entire monitor that freezes, or just the window?
Threads are simple, if you've been avoiding them:
Thread thread = new Thread(() -> intensiveMethod());
thread.start();
intensiveMethod
being the method you call that freezes your monitors. If it's not you calling it, try installing the latest JRE and JDK.
Upvotes: 0