×

Discussion Board

Results 1 to 4 of 4

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    LWUIT, SDK 2.0 Increasing RAM usage every time when selecting button.

    Hello,
    I've been making an application with SDK 2.0 and the latest LWUIT. I've made a form and some buttons on it, and I found this strange thing:
    In the emulator the current RAM usage is shown. When a press a button, drag my mouse away, and then release the mouse button, my RAM usage goes up with 1-3 MB. So basically I select a button, but dont press it. If I would do this 100-200 times, I would get an OutOfMemory error probably. Anyone experienced this earlier and found a solution?
    I was not able to test this on a device, just on the emulator, it could be also the fault of the emulator (but i dont think so).
    Thanks for your help,
    zoiddani

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,750

    Re: LWUIT, SDK 2.0 Increasing RAM usage every time when selecting button.

    Most probably it is an emulator issue. Anyway, you can track memory details in the device via Runtime. And there is a Remote Device Access service in "Devices" above, you can try your code there even if you do not have a device at hand.

  3. #3
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429

    Re: LWUIT, SDK 2.0 Increasing RAM usage every time when selecting button.

    Hi DanielZolnai! Welcome to Nokia Developer Discussion Boards!!

    As you might know, from a Java app you can find the total memory of a device with "Runtime.getRuntime().totalMemory()" and Free memory with "Runtime.getRuntime().freeMemory()" - you can use these methods to find out the memory consumption during runtime and print it to the screen, while the app is running in a real device. If you dont have a real device, you can try in RDA also.

    If you are new to RDA, please read more details here http://www.developer.nokia.com/Devic...device_access/

    Hope this helps ?

    Regards
    Gopal
    Twitter : @balagopalks
    Linkedin : @balagopalks

  4. #4
    Registered User
    Join Date
    Mar 2013
    Posts
    3

    Re: LWUIT, SDK 2.0 Increasing RAM usage every time when selecting button.

    Thanks for your help! As I figured out with my increasing Java knowledge, this type of behavior is normal. The KVM stores the product of the animation of the button in the memory, and thats why it is increasing. If the memory would be full, the KVM would just call the garbage collector, and it would clean up the mess. I've tested this with the System.gc() command, and it works. Thanks for your help!

Similar Threads

  1. Replies: 2
    Last Post: 2012-11-23, 07:39
  2. LWUIT Increasing size of menu bar
    By vishal.vpb in forum Mobile Java General
    Replies: 1
    Last Post: 2012-01-06, 06:41
  3. Need suggestions regarding the usage of LWUIT and J2ME Polish
    By kpvrlakshmi in forum Mobile Java Tools & SDKs
    Replies: 4
    Last Post: 2010-05-14, 23:47
  4. Selecting a Access point takes much time
    By apus29 in forum Symbian
    Replies: 3
    Last Post: 2009-08-19, 10: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
  •  
×