Select to view content in your preferred language

Zoom hangs when going from high level to low

9357
35
10-19-2015 11:41 AM
DanielGarcia
Regular Contributor

When I execute centerAndZoom method or other method that change zoom level from high level like 19 to low level like 2, application hangs taking a lot of memory (up to 1,5 Gb).

You can test it with this simple jsfiddle... https://jsfiddle.net/dgarcrom/1dbvjqyx/

This not happend with IE, it's happend with Chrome 46.0.2490.71.

Any ideas??

Thank you.

0 Kudos
35 Replies
ChrisSmith7
Honored Contributor

Seems like a memory leak on Chrome. I tried a few different API versions to see if that helped... no such luck. Very quickly, we go from low memory usage to ~ 4 gbs in about 10 seconds (then, it crashes for me - "aw, snap"):

ChrisSmith7
Honored Contributor

Interestingly, if I attach a debugger and step through it slowly, it ends up working ok.

0 Kudos
ChristopherTotty
Deactivated User

We are also experiencing this issue.  Chrome 32-bit very quickly runs up its ~3.8GB of memory and then crashes with an "Aw, Snap!"

0 Kudos
DanielGarcia
Regular Contributor

I was playing with some of these properties but it doesn't work.

navigationMode: 'classic',

optimizePanAnimation: true,

displayGraphicsOnPan: false,

I think this is a very serious problem, because chrome takes all memory available and hangs the computer.

All ESRI Javascript users are potencial victims.

0 Kudos
ChristopherTotty
Deactivated User

I just tried using navigationMode: 'classic', and it works!

What is strange is, it doesn't work on its own.  I happened to have a line of code placed just before the original poster's call to zoom in order to go to the debugger in Chrome Dev Tools.  Without dev tools open, this line should do nothing.  Without navigationMode set it does do nothing, but with navigationMode set it allows the zoom to complete.

I have no information on the actual cause other than that, but I am going to place some debugger; calls before the locations in our code where we zoom and see what happens!

Edit: I have updated the fiddle to check for Chrome 46 Win32 before running the debugger; line, just in case a supported web browser handles calls to debugger; without the browser's dev tools open.

See updated fiddle: ESRI JS API 3.13 - JSFiddle

Edit 2: Sorry for the false hope, but after multiple attempts the issue does persist.  It does appear that navigationMode 'classic' did help, but debugger; or no, I am still seeing crashes.

0 Kudos
NathanaelVaughan
Emerging Contributor

No dice for my applications. I have a version using an older version of the api and another using 3.12 (also not current) and get the same "seizing" behavior on both.

Clearly it works in the jsFiddle though.

Since it appears to be associated with "rapid" zooms, I'll probably write an intermediate function to zoom incrementally based upon some trial-and-error sensitivity testing.

Anyone have a better idea?

0 Kudos
ChristopherTotty
Deactivated User

Yes, it is a serious problem.  I was hoping there would be a solution posted here overnight, but now I guess I know what I will be working on this morning.

0 Kudos
by Anonymous User
Not applicable

Can you confirm Chrome is crashing only when using the code within JSFiddle or Sandbox or does it crash as well when using "local" code? In the tests I did it crashes only when using JSFiddle/Sandbox.

0 Kudos
ChristopherTotty
Deactivated User

I am seeing the issue locally running a site from IIS and on our production site (also IIS on a Windows Server box).

0 Kudos