3

I am drawing a pretty large polyline with 5000 points in it at the max, I parse every location to make sure it's not a dud (exclude after a certain accuracy and distance away from the last point). But when zoomed out to level 8 its fine, but when I zoom in a bit more I get a StackOverflowError:

06-30 22:02:14.876: I/dalvikvm(10897): threadid=19: stack overflow on call to Lmaps/i/av;.c:FLLL
06-30 22:02:14.876: I/dalvikvm(10897):   method requires 40+20+0=60 bytes, fp is 0x5a5b8318 (24 left)
06-30 22:02:14.876: I/dalvikvm(10897):   expanding stack end (0x5a5b8300 to 0x5a5b8000)
06-30 22:02:14.876: I/dalvikvm(10897): Shrank stack (to 0x5a5b8300, curFrame is 0x5a5bbe5c)
06-30 22:02:15.025: W/dalvikvm(10897): threadid=19: thread exiting with uncaught exception (group=0x41490930)
06-30 22:02:15.056: E/AndroidRuntime(10897): FATAL EXCEPTION: GLThread 2387
06-30 22:02:15.056: E/AndroidRuntime(10897): java.lang.StackOverflowError
06-30 22:02:15.056: E/AndroidRuntime(10897):    at maps.i.av.a(Unknown Source)
06-30 22:02:15.056: E/AndroidRuntime(10897):    at maps.i.az.a(Unknown Source)
...
...

Is there any way to get around this or anything? Is there any point posting code for this question? If so just ask away.

I am using Google Maps API v2 for Android and using a SupportMapFragment although I am using a Galaxy Nexus 2 with Android ver 4.2.2 on it. (Real device)

Peter O.
  • 32,158
  • 14
  • 82
  • 96
FabianCook
  • 20,269
  • 16
  • 67
  • 115

1 Answers1

0

Based on the Exception itself, it seems like you have a memory leak. You can read some information about memory leaks on http://android-developers.blogspot.co.uk/2009/01/avoiding-memory-leaks.html

Kunal S. Kushwah
  • 883
  • 1
  • 8
  • 19
  • Oh bum. I should maybe close that cursor – FabianCook Jun 30 '13 at 10:17
  • After reading that I did what it said to look out for (context stuff) made sure I wasn't keeping anything not needed, the activity at this stage is very very simple, it is only caused from drawing the map. – FabianCook Jun 30 '13 at 10:27
  • check this answer --- http://stackoverflow.com/questions/10303727/improving-performance-on-google-maps-drawing-long-paths – Kunal S. Kushwah Jun 30 '13 at 10:32
  • Ive decided to just have like 10 points showing at a time and having a time line where they can drag along to get the different paths, otherwise I will always have this problem. Thanks. Ill accept since you gave me the idea with the link. – FabianCook Jun 30 '13 at 10:48
  • How is `StackOverflowError` related to memory leaks? – MaciejGórski Jun 30 '13 at 22:11