Select to view content in your preferred language

Very high CPU usage when JMap is added to a UI

3384
5
Jump to solution
01-29-2013 11:12 AM
PatrickKuhlman
Emerging Contributor
I have a project where I create a JLayeredPane, add a new JMap to it, then add the JLayeredPane to a JFrame with a BorderLayout. Before setting the JFrame to visible, I add an AcrGISTiledLayer and a MessageGroupLayer, in that order. As soon as the window is visible, it consumes 100% of the CPU. If I do not add a MessageGroupLayer, the CPU remains mostly idle. How can I fix this?
0 Kudos
1 Solution

Accepted Solutions
MarkBaird
Esri Regular Contributor
Okay, I've tested your code in Windows and Linux (I'm using Ubuntu) and there doesn't appear to be an issue.

Starting up the application is very quick and there is no peak CPU usage.

Is there any chance you can upgrade to 10.1.1?

There has been a lot of work on the core rendering code in this release and it's possible your issue has been fixed.

Let me know how you get on.

View solution in original post

0 Kudos
5 Replies
MarkBaird
Esri Regular Contributor
I've tried to replicate this and didn't see the issue you reported.  I was using version 10.1.1. of the API.

Is there any chance you could pop the reproducing code on the forum?

Thanks

Mark
0 Kudos
PatrickKuhlman
Emerging Contributor
Hey Mark,

Please see the code below. I've also included some screenshots from JVM Monitor showing the threads using the CPU. I'm using the version before 10.1, which I believe is 1.0. Hope it helps.

Also: It might help to know that we do not see this issue on Windows but we are seeing it on Linux [Red Hat release 6.2, Kernel Linux 2.6.32-220.el6.x86_64, GNOME 2.28.2]

I apologize for the text file; apparently it ate my line breaks.
0 Kudos
MarkBaird
Esri Regular Contributor
Okay, I've tested your code in Windows and Linux (I'm using Ubuntu) and there doesn't appear to be an issue.

Starting up the application is very quick and there is no peak CPU usage.

Is there any chance you can upgrade to 10.1.1?

There has been a lot of work on the core rendering code in this release and it's possible your issue has been fixed.

Let me know how you get on.
0 Kudos
PatrickKuhlman
Emerging Contributor
Thought I'd post back an update: 10.1.1 did fix the CPU issue. Our latest build shows little to no CPU usage when idle.
0 Kudos
MarkBaird
Esri Regular Contributor
Thanks for the update - that's good to hear

Mark
0 Kudos