×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    103

    Decreasing performance

    Hi,
    I created an application that retrieves the images from the viewfinder one after another. When running the application I calculate the frames per second (fps) that I am able to retrieve from the viewfinder. At first I get 13-15 fps and slowly it decreases to 10-12 fps and eventually stays on 8 fps (it eventually stays on 8 fps after 5 minutes or so). Is there a possiblity that my process's priority is decreased? Or else how can this decrease in fps can be explained? I know that there should be a runtime optimizer such as JIT or similar, but that should cause better fps as time passes, no?
    I don't instantiate any new objects and don't have any memory leaks during the running of the applications. I've checked this in the emulator and everything looks ok.
    Any suggestions?

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Decreasing performance

    Was the decreasing performance noticed on real phones or on the emulator? Which phone?

    Without any more information my guess is that memory is getting low. (yes, I read your message and the memory comment also :-)

    Hartti

  3. #3
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    103

    Re: Decreasing performance

    It's N95 and N73. How can the memory get low? I don't allocate anything during runtime

  4. #4
    Regular Contributor
    Join Date
    May 2004
    Posts
    147

    Re: Decreasing performance

    Check what freeMemory() says and try seeing if manually running gc() matters.
    I think I encountered in the past an API method (it was RMS related) that had a memory leak. Maybe that's what happens in this case.

  5. #5
    Super Contributor
    Join Date
    Apr 2003
    Location
    USA, CA
    Posts
    7,191

    Re: Decreasing performance

    How could the system running low on memory?
    You are reading images from the camera in quick succession. It could be possible that even though there is no "memory leak" the system / garbage collector does not have time to fully release the memory. At some point the system has to allocate some time for the garbage collector to release the memory and hence the fps is slowed down. Did I make any sense (all this is of course pure guesswork without exactly knowing what your MIDlet does etc.)

    Hartti

  6. #6
    Regular Contributor
    Join Date
    Mar 2007
    Posts
    103

    Re: Decreasing performance

    Just to update this thread (for future developers who encounter this sort of problem). I've done some more testing using the WTK profilter and indeed the JVM does instantiate new objects, for example when drawing a string on the screen a String object and string buffer are created. To solve the problem (more precisely to make it worse than it is), I'm calling the garbage collector once every few seconds to prevent the automatic garbage collection that takes too long when the memory is too full.

    Thanks again to Ehud and Hartii

Similar Threads

  1. Replies: 4
    Last Post: 2007-11-26, 09:38
  2. Performance estimation with emulators?
    By javanerd in forum Mobile Java General
    Replies: 3
    Last Post: 2007-04-23, 12:04
  3. wide variation in emulator correctness and performance
    By jgreif in forum Tools and SDK Feedback (Closed)
    Replies: 0
    Last Post: 2006-12-23, 01:04
  4. Symbian OS+nokia 6600+MMC card performance issues
    By mail2gops in forum General Development Questions
    Replies: 1
    Last Post: 2005-12-16, 14:16

Posting Permissions

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