Closed akosmaroy closed 10 years ago
if I use a WMSBillElevationDataProvider instead, like this:
ElevationDataProvider dem = new WMSBillElevationDataProvider(
new URL("http://data.worldwind.arc.nasa.gov/elev"), "srtm30",
demSector, 0);
I still get an out of memory error, although the stack trace is different:
12-10 14:16:46.473: W/dalvikvm(1637): threadid=11: thread exiting with uncaught exception (group=0x409c01f8)
12-10 14:16:46.473: E/AndroidRuntime(1637): FATAL EXCEPTION: GLThread 129
12-10 14:16:46.473: E/AndroidRuntime(1637): java.lang.OutOfMemoryError
12-10 14:16:46.473: E/AndroidRuntime(1637): at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
12-10 14:16:46.473: E/AndroidRuntime(1637): at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:424)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.specific.SQLiteStorage_Android.readImage(SQLiteStorage_Android.java:255)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.CachedDownloader.getCachedImageResult(CachedDownloader.java:48)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.CachedDownloader.requestImage(CachedDownloader.java:135)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.TileTextureBuilder.start(TileTextureBuilder.java:151)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.TileTextureBuilderStartTask.execute(TileTextureBuilderStartTask.java:20)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.FrameTasksExecutor.doPreRenderCycle(FrameTasksExecutor.java:103)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.generated.G3MWidget.render(G3MWidget.java:190)
12-10 14:16:46.473: E/AndroidRuntime(1637): at org.glob3.mobile.specific.ES2Renderer.onDrawFrame(ES2Renderer.java:64)
12-10 14:16:46.473: E/AndroidRuntime(1637): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1462)
12-10 14:16:46.473: E/AndroidRuntime(1637): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1216)
12-10 14:16:47.144: I/dalvikvm-heap(1637): Clamp target GC heap from 64.009MB to 64.000MB
12-10 14:16:47.144: I/dalvikvm-heap(1637): Forcing collection of SoftReferences for 262160-byte allocation
12-10 14:16:47.403: I/dalvikvm-heap(1637): Clamp target GC heap from 64.008MB to 64.000MB
12-10 14:16:47.413: E/dalvikvm-heap(1637): Out of memory on a 262160-byte allocation.
For the correct working of G3M is needed to set on AndroidManifest.xml the property android:largeHeap=true in the Application tag. http://developer.android.com/guide/topics/manifest/application-element.html
Anyway, with this property set true, this problem could be happen if you are loading a very large datasets, in that case you have to change the strategy loading the data (LoD, etc...) Surely your app is going to work correctly only setting this label.
Thanks.
my main issue is that I don't seem to have control over this out of memory incident. even if I set largeHeap=true, and I don't have anything else in my app (no other objects present other than G3MWidget), and is a generally clean android (not much else running), I still get an out of memory issue.
it would be nice to be able to control this in a way, so that G3M doesn't load that many bitmaps, etc. so that it drives itself out of memory
Diego, I double-checked, and actually I'm on the purgatory branch.
to reproduce the issue, you just simply need to create an Activity with my code above, and just run. wait a little bit, you see that g3m is downloading more and more tiles, and trying to display in more and more detail. and then it runs out of memory :(
Hi,
I'm experimenting with a simple code sample with g3m on Android, and I consintently get an out of memory exception. my code is a very simple activity:
where elev.bil is a file I got by the following URL:
http://data.worldwind.arc.nasa.gov/elev?REQUEST=GetMap&SERVICE=WMS&VERSION=1.3.0&LAYERS=srtm30&STYLES=&FORMAT=image/bil&CRS=EPSG:4326&BBOX=45.9,7.6,47.5,9&WIDTH=576&HEIGHT=504
and after a short while, the exception I get is always the same: