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
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
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?
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.
Forum posts: 2009
- 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
Forum posts: 7
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?
Forum posts: 1246
When leaving, the cleanupstack will then clean up everything, so no memory is lost.