Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
webmasterpdx
Posts: 558
Registered: ‎11-25-2008
My Device: Not Specified

Re: Help with some internal specs on STORM. Might require someone who works at RIM.

I'm confused about what you are talking about.

Of course, memory fragmentation has nothing to do with memory leakage. They are two different phenomena. I thought someone had asked why memory seems to grow slightly from time to time and then go down again when you do some resets. These are most commonly caused by memory fragmentation. Memory leakage is a bug in the program. Memory fragmentation isn't.

 

I'm not sure if you were the person who asked that question and maybe you were talking about your program which has a memory leak. Memory leaks will eat up all memory usually pretty quickly.

In embedded systems, is usually best to declare an array of the structures or classes you want to use at the start of the program so that they'll be erased at the end of the program by the garbage collector. However, there are situations where you have to use dynamic allocation and then you must be careful to always free memory that you allocated or you'll create a leak. I generally try to avoid dynamic allocation in embedded code wherever possible (I'd consider a blackberry app as an embedded app). It's been too long since I used the persistant storage so I can't remember the API, so I can't remember if it forces you to allocate or what..... Usually persistent code is something that you plan on keeping around to hold some data associated with your app even when not running it for the next time you run (like an address book or something).

 

It all depends on your app.

 

Good luck.

-D

Please use plain text.
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Help with some internal specs on STORM. Might require someone who works at RIM.

I was the one who asked about the why the memory seemed to "grow."

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.
Developer
ydaraishy
Posts: 562
Registered: ‎09-30-2009
My Device: Not Specified

Re: Help with some internal specs on STORM. Might require someone who works at RIM.

Memory can grow for the simple reason that the JVM garbage collects periodically.

Please use plain text.
Developer
rcmaniac25
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.634 Dev OS, Z30 (STA100-5)-10.3.1.634 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Help with some internal specs on STORM. Might require someone who works at RIM.

That sounds odd but I understand from the previous posts why that happens. It makes me wonder why they don't compact the memory so those spaces so free memory doesn't decrease.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Please use plain text.