Win a copy of Learning Java by Building Android Games this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

How to know what is consumming most CPU  RSS feed

 
Ranch Hand
Posts: 87
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,

I am facing a problem raised with legacy code that I don't know what to do.

The issue is regarding  an app developed in java-swing. After several monts working on the app I have just spot it is consuming high amounts of CPU time when opening a PopupMenu based on JPopupMenu.
This Class belongs to a jar file wrapping the calls to JPopMenu. When opening that popup menu you see runing a top command that X process reaches 100% and java around 70%. The app stills looks fluent, but I was told to reduce the CPU consume. By contrast, running jconsole or jvisualvm the CPU is no more than 10%. Then... I don't understand what happens: why those high differences between top and jconsole; don't understand how to relate X process and java. Could be the rendering/ the mouse listeners? Why this Component take over the CPU and the rest of windows, the behaviour is correct?

By the way, the app is working over RHEL 7 and motif windows manager as desktop. One more thing: when trying to debug the app, eclipse stops at breakpoint and everthing freezes.

May you please give me some light to solve the problem?

Thanks in advance.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!