×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    123

    How to detect j2me memory leaks?

    I use Sun Java (TM) Wireless Toolkit 2.5.2_01 for CLDC to develop my program. If I run 20times,it throws outfomemory error.how to detect this?Is there some tools?
    Thanks.

  2. #2
    Super Contributor
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: How to detect j2me memory leaks?

    There is a discussion about memory "leaks" here; it may give you some ideas.

  3. #3
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How to detect j2me memory leaks?

    There is a memory profiling tool in the WTK.

    Note that, since Java uses a garbage collection system, Java programs are not prone to memory leaks in the sense that C or C++ programs are.

    Graham.

  4. #4
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    123

    Re: How to detect j2me memory leaks?

    Thanks!
    The tool is memory monitor?

    Is there a tool like hooklogger?
    The hooklogger is useful and easy.

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How to detect j2me memory leaks?

    Yes, memory monitor.

    No, hooklogger is for detecting C or C++ memory leaks, and these cannot exist in Java. C-based tools work by finding memory that has been allocated and never de-allocated by the programmer. Since de-allocation in Java is automatic, the same process does not make sense.

    Graham.

  6. #6
    Regular Contributor
    Join Date
    Dec 2006
    Posts
    123

    Re: How to detect j2me memory leaks?

    Thank you!

  7. #7
    Registered User
    Join Date
    Oct 2008
    Posts
    2

    Thumbs up Re: How to detect j2me memory leaks?

    Quote Originally Posted by grahamhughes View Post
    There is a memory profiling tool in the WTK.

    Note that, since Java uses a garbage collection system, Java programs are not prone to memory leaks in the sense that C or C++ programs are.

    Graham.
    Quote Originally Posted by grahamhughes View Post
    Yes, memory monitor.

    No, hooklogger is for detecting C or C++ memory leaks, and these cannot exist in Java. C-based tools work by finding memory that has been allocated and never de-allocated by the programmer. Since de-allocation in Java is automatic, the same process does not make sense.

    Graham.
    JAVA MEMORY LEAKS
    http://weblogs.java.net/blog/enichol...tanding_w.html Very intresting article

  8. #8
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: How to detect j2me memory leaks?

    I use the phrase "memory leak" only to refer to a situation where allocated memory becomes impossible to recover. This cannot happen in Java.

  9. #9
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: How to detect j2me memory leaks?

    well the memory monitor is just that : an utility to monitor memory usage :P
    If you see the user memory keeps onm growing it may give you an idea on what kind of objects that memory is lost to...
    Just one tip : don't use the stated memory usage as a given fact ! It may be different on different devices, but it's still a good GUIDELINE on how memory is used (so it should me more of a memory allocation monitor :P )...
    Just my 2 cents about this...

Similar Threads

  1. Can I protect the memory used by J2ME
    By arspeiser in forum Mobile Java Networking & Messaging & Security
    Replies: 3
    Last Post: 2009-01-02, 10:58
  2. How to preload J2ME app. to memory card?
    By ppiggy in forum Mobile Java General
    Replies: 0
    Last Post: 2007-02-04, 13:36
  3. N70 'Memory Full' error using J2ME, Bluetooth and TCP
    By scoobyboy in forum Mobile Java General
    Replies: 3
    Last Post: 2006-12-06, 22:21
  4. Memory leaks when run internet on emulator
    By kompotFX in forum Symbian
    Replies: 3
    Last Post: 2006-11-25, 13:45
  5. How to track memory leaks?
    By xedarius in forum Mobile Java General
    Replies: 8
    Last Post: 2006-07-31, 15:54

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×