How to minimize % failure of application in LowMem

Login to reply to this topic.
Fri, 2006-04-14 06:46
Joined: 2006-04-14
Forum posts: 19
Hi,I am testing my application on LowMem,but it is giving high % failure on it.So if any body knows how to minimize it pls reply fast.Waiting for reply.
GOOD DAY

Fri, 2006-04-14 09:05
NewLC AdministratorSymbian AccreditedForum Nokia Champion
Joined: 2003-01-14
Forum posts: 2009
Re: How to minimize % failure of application in LowMem
- Design your app so that RAM is used sparingly
- Design your app so that it can handle allocation failure
- Follow Symbian rules of coding for memory allocation (two step construction, cleanup stack)
- Add a few TRAP to catch and handle memory failure of non-critical features


Eric Bustarret
NewLC Founder & CEO / Professional Symbian OS Consultant

Sat, 2006-04-15 22:01
Joined: 2006-04-15
Forum posts: 7
Re: How to minimize % failure of application in LowMem
Quote from: eric
- Design your app so that it can handle allocation failure
What is the correct way to handle an allocation failure?
Is leaving with KErrNoMemory enough?
I made sure all my allocations are done using new (Eleave) but still I have a high % of failures using LowMem.
I also have no TRAPS in my code so any leave just goes to the GUI framework (S60 in my case).
Am I missing something? why do I still get LowMem failures?
Sun, 2006-04-16 14:52
Joined: 2004-11-29
Forum posts: 1246
Re: How to minimize % failure of application in LowMem
Just leaving is not enough, you must also make sure that everything allocated is on the cleanup-stack, or owned by something on the cleanupstack that will delete it when it itself gets cleanup. (or owned by something that is owned by something that is on the cleanupstack etc, you get it...)

When leaving, the cleanupstack will then clean up everything, so no memory is lost.

  • Login to reply to this topic.