ThinkGeo.com    |     Documentation    |     Premium Support

OutOfMemory on map with many shapefiles

Hi,

I have an application that in a specific situation needs to open an activity with a MapView and it calls another activity also with a MapView. When this occurs an OutOfMemory exception is thrown.

The first activity (with the map) already consumes about 300 MB. In our application we have several shapefiles. Even without loading elements on the map, only with shapefiles, the memory consumption is very high.

I’ve tried to simplify the code but still can’t get a satisfactory result.

This is normal? Is the consumption of this package (ThinkGeo) really high?

Hi Danilo,

I did a really simple sample to test it, it looks the memory usage only 3.7mb.

Here is the test sample:
9591.zip (105.0 KB)

I think if you hadn’t load your shape files into memory, the size won’t get increased. So could you please double check your code and see which code cause it? You can also modify the sample and upload it again.

Regards,

Ethan

Hi Ethan,

Thanks for reply!

I’ll make a test again using this code

Hi Danilo,

Any news please let us know.

Regards,

Ethan

Hi Ethan,

When loading my shapefiles, the memory consumption grew, see below:

I’II open a ticket because in the test project I have corporate files.

Thank you

Hi Danilo,

We will view your project in ticket and reply there.

Regards,

Ethan