Ask Your Question

Get OutOfMemoryError when using OccupancyGridLayer to display map

asked 2012-07-09 10:02:52 -0500

ira gravatar image

Hi all,

I run my program on a real device with 1GB memory. I tried to use OccupancyGridLayer to display map message i got from robot. However, after about 10s processing, I got OutOfMemoryError and the app was forced to stop. Does anyone have the same problem? Is there any way to solve this problem?

Thanks a lot!

edit retag flag offensive close merge delete



Could you include the map parameters for the map you trying to display (size in x and y, pixels/meter, etc)? Basically the MapMetaData that goes along with the OccupancyGrid message you are trying to display.

Eric Perko gravatar image Eric Perko  ( 2012-07-09 10:12:02 -0500 )edit

Hi, thanks for the reply. Here is the data:
width = 428 height = 580 resolution = 0.025 map load time = 0:0

ira gravatar image ira  ( 2012-07-09 21:05:28 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-07-11 21:15:51 -0500

damonkohler gravatar image

I'm in the process of addressing this issue. See

edit flag offensive delete link more

answered 2012-07-09 22:08:59 -0500

Lorenz gravatar image

Well, I guess your map is just too big. Its size will be about 9MB. Is your map really that big? If not, look at the patch attached to this ticket.

If you need the map just for visualization, you could implement a proxy that compresses it, e.g. as a PNG file. You can find some code doing this in the rosjava project, repository google, package name compressed_visualization_transport. This solution would probably require some work though.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-07-09 10:02:52 -0500

Seen: 249 times

Last updated: Jul 11 '12