Shop OBEX P1 Docs P2 Docs Learn Events
Memory leak tool — Parallax Forums

Memory leak tool

bpwilliebpwillie Posts: 3
edited 2007-05-14 04:56 in General Discussion
Peter,
After multiple minutes of program execution I get various IDE errors, sometimes it's 0024, sometimes 0028, and sometime 0042.· The guy at the help desk said this could occur due to memory leaks, though I would have thought I would have gotten an out of memory exception.

Anyway, I understand that Javelin Stamp has no garbage collection.· I've read through the postings and·understand the problems identified there.· I've·looked through my code multiple times·and cannot see a problem with memory leaks or·uninitialized variables.

Is there a memory analysis tool that can show in real time how much free memory there is, or where leaks occur?· (I didn't see one listed in the documentation or forums.)

Here's a list of the various errors I'm getting:
[noparse][[/noparse]Error IDE-0042]Unknown unhandled exception in JVM (1151).
Description: This is an internal error.
Solution: Report the error to technical support.
[noparse][[/noparse]Error IDE-0028]Unhandled exception in JVM:java.lang.IndexOutOfBoundsException
Exception thrown in file ...\Uart.java at line 547
[noparse][[/noparse]Error IDE-0028]Unhandled exception in JVM:java.lang.NullPointerException
Exception thrown in file ...\UartTools.java at line 11
[noparse][[/noparse]Error IDE-0024]Unknown bytecode in the JEM file (fconst_1)
[noparse][[/noparse]Error IDE-0042]Unknown unhandled exception in JVM (1182).
[noparse][[/noparse]Error IDE-0028]Unhandled exception in JVM: java.lang.IllegalArgumentException
Exception thrown in file ...\UartTools.java at line 11.
[noparse][[/noparse]Error IDE-0042]Unknown unhandled exception in JVM (1206).
As you can see, these errors don't occur in my code so it's hard to know what the root cause is.· Also some of the line numbers refer to class declarations and not specific code statements.

Any pointers you might have would be greatly appreciated.

Thanks,
bpwillie

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-03-19 16:08
    Have you tried Project->debug instead of Project->program?
    That lets you single step your program or execute up to
    a breakpoint . Then you can check the call/stack trace.

    Also, posting your code might help us to identify the cause.
    You can use int bytesFree = stamp.core.Memory.freeMemory()
    to know how much memory is available. If that number keeps
    decreasing then you have a memory leak.

    regards peter

    Post Edited (Peter Verkaik) : 3/19/2007 4:18:15 PM GMT
  • bpwilliebpwillie Posts: 3
    edited 2007-03-19 16:29
    Peter,

    I use debug a lot.· Unfortunately, the error is never consistant so it's impossible to recreate at will.· Sometimes the program runs fine for an hour, sometimes just for a few minutes.· Finding the problem by stepping through it with debug would be extremely laboreous, if not impossible due to timers, etc.

    I had hoped the Memory Usage tab under debug would help, but it doesn't seem to get updated in real time.· It appears to describe memory usage at the start of the program only.· Am I correct in this?

    The code is rather lengthy, and not for public viewing.· I could email it to you if you wouldn't mind taking a look at it.

    Thanks,
    bpwillie
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-03-19 16:36
    You can mail it and I will take a look at it.
    You can find my email address in my member profile.

    regards peter
  • setMethodsetMethod Posts: 1
    edited 2007-05-14 04:56
    I had unclear uart errors that went away by restarting the uart. Runs for years now.
Sign In or Register to comment.