Running out of Memory

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, imaqine, 99jonathan

New User
Posts: 1
Joined: Mon May 21, 2007 1:43 pm
Location: Germany, Braunschweig

Running out of Memory

Postby Legopard » Mon May 21, 2007 2:02 pm

I'm a student working on a project with Mindstorms NXT using the Lejos Firmware.

I wrote a nice program for my bot enabling it to overcome obstacles, follow black lines and recognizing white marks. Everything is working fine, but after repeating some of the sub-programs (I use a big application loop including a menu), it runs out of memory.
I don't use any local variables like Strings or counters which could consume the memory when its function is called again and again.

Does somebody know a memory leak in the VM or any other trap I could have stepped in?

I also found the Recycler Interface and its related classes but there was no example and I couldn't find any further documentation about it.
Maybe somebody has used these classes before and can give me little start up?

Maybe there is something to find about my problem in the new book about Lejos Programing but I'm still waiting for the delivery.. :(

Thanx in advance,
To the void we have to travel.

New User
Posts: 6
Joined: Mon May 21, 2007 1:10 pm

Postby MeOl » Mon May 21, 2007 4:49 pm

if i remember correctly, garbage collection is still on the todo-list (so not yet implemented). do you create a lot of new objects?
but i´m not the hardcore java programmer, so maybe i´m wrong..

leJOS Team Member
Posts: 965
Joined: Mon Feb 05, 2007 1:27 pm

Postby lawrie » Tue May 22, 2007 7:48 pm

Send me your program and I will have a look at why it might be running out of memory - I don't know of any issues other than the lack of a garbage collector that cause leaking of memory. It is usually because you are creating new objects in a loop somewhere.

The flash version of lejos, which will be in the next release has about 30kb more memory available to Java programs, so your program should last longer!

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 3 guests