LowMem: a low memory stress tool.
Download posted December 14th, 2004 by eric
in
The LowMem tool is a free test tool developed by Symbian for use during Symbian Signed testing. The tool aims to verify an application's handling of the Low Memory Condition during start-up. Handling of Low Memory situations has been the number one cause for failure in Symbian Signed...
The application is straightforward to use:
| 1. Specify an amount of heap memory that shall be made available for your application, the increase of memory between each try (the LowMem tool will launch your application several time, each time giving it a little bit more heap) | ![]() |
| 2. Select the application to stress | |
| 3. Not easy to boot with 1024 bytes of free heap!!! | |
| 4. Here is the final result: the application has failed to boot in 73% of the test (which is really too much according to Symbian Signed criteria but very little heap memory has been made available...). The application however never leaked | ![]() |
You can download this application for UIQ or Series 60 from Symbian Signed site (a registration is required to download this tool). The Series 80 port is ongoing.










> LowMem: a low memory stress tool.
I've tested my application, here are the results: Test Failed (%): 0 Mem leak: 1
Do I have to be worried by the value of memory leak? I think that it's not easy to find (probably) one line in the code that in low memory situations may leak (in normal situations everything works fine). How to 'simulate' it in emulator?
> LowMem: a low memory stress tool.
> LowMem: a low memory stress tool.
A much simpler plan, which even Symbian themselves dont really seem to understand anymore, is to use the EPOCHEAPSIZE directive in your MMP file.
By defn the OS is not allowed to run the app unless the min heap size can be granted to your app. You can therefore tweek the min size you specify (e.g. from the results from the LowMem test tool) such that your app cannot run out of memory on start up. Agreed the SDK docs are a bit vague on this, however one reason for the existance of the lower bound is that the is no point launching an app if its going to fail on OOM at any stage though its startup phases (whether it crashes or not is irrelevant to the end result - the app is not running).
Whether any of the Symbian Signed testers understand this I cant tell you - i.e. they may well simply run your app with LowMem test tool blindly ignoring the EPOCHEAPSIZE statement.
You do need to be sensible using this, your heap size will not go below the min you define, thus if on startup you alloc + load lots of things that are not required for the rest of the app then you will reserve memory from the system that no other app can use. E.g. blindly setting to say 1MB just so app guarenteed to start means you will take a min of 1MB regardless of whether you only need 10K - i.e. the OS wont garbage collect the 990K cos you told it you needed a min of 1MB to work...
> LowMem: a low memory stress tool.
I tried the EPOCHEAPSIZE but doesn't work...I simply added a line "EPOCHEAPSIZE 50000 1000000" into the MMP file, the application still fails same times (The test ends at around 30k heapsize). Did I make something wrong?
More importantly, what kinds of exception handling are needed to make an application "really" meeting the 10% target? I mean, what the Symbian Signed guys really want developers to do? It seems that an application generated by the S60 SDK appwizard still fails more than 50%...
> LowMem: a low memory stress tool.
> LowMem: a low memory stress tool.
I would not recommend the EPOCHEAPSIZE method.
First of all, the Symbian documentation is (as often) a bit vague on this statement, but EPOCHEAPSIZE does not apply on GUI applications which are just polymorphic DLLs loaded from the GUI launcher process. EPOCHEAPSIZE only applies to executables. So if you create your own server application or some kind of engine, you can use this statement to control the size of your heap.
Secondly, if you use this statement (for an executable) to make sure that you will always have enough memory, you will most of the time reserve more memory than you actually need. Which is bad, if you broaden your perspectives and look at the complete system.
Thirdly, if you change your source code you need to remember to update the minimum heap size number in EPOCHEAPSIZE accordingly. If you do not properly take care of memory failures, you need to take into considerations all possible functions that can allocate memory. Do you possibly load any polymorphic DLLs? Do you always know how much heap these DLLs need?
I think you better make sure that all memory failures are taken care of properly,instead! And for this purpose LowMem is a good tool to use on your GUI applications.
> LowMem: a low memory stress tool.
> LowMem: a low memory stress tool.
You need to do some proper memory failing testing using UHEAP_FAIL and other macros. These macros cause the the new(ELeave) method to fail deterministic way so you can find areas that will cause memeory leaks.
You can find a quality descritpion of this practice in Symbian OS Explained.
> LowMem: a low memory stress tool.
See this forum nokia article for explanation of symbian leak detection macros.
:-)
> LowMem: a low memory stress tool.
> LowMem: a low memory stress tool.
hi folks,
I downloaded the .SIS for low mem tool but some how I am not able to install that on my deivice. I have Nokia E63 device which is S60 V3.
Can anybody help ?
> LowMem: a low memory stress tool.
> LowMem: a low memory stress tool.
Hi Eric,
I am very new to LowMem tool. The question that I have is the following. The SimpleApp that is installed together with the LowMem, fails the test with 59% Test Failures. This happens when I do the test without changing any of the LowMem Settings. I run the test on Nokia 7610 (S60) device. I realized, by doing the test that SimpleApp requires around 32K of memory. When I set this number to Min heap free setting of LowMem, then SimpleApp succeeds the test with 0% failures. My question was whether I am allowed to change these settings in order to "make" the application pass the test. According to LowMem User Guide (issued 1.6), on paragraph "16 Quick Guide to running a test", there is a step "Restore factory settings via the menu option". Also, on "13 FAQ", on question "2. Do I need to change the settings before running a test"? the answer is "No. You should not change the settings unless for debugging or recommencing a test.". What am I doing wrong and, with the factory settings, the SimpleApp fails the test? At your article, you say that I have to actually change the setting of Min heap free to the value that the application that I am testing requires. Is this what I understand correct? Why the Symbian guidelines don't put the value to 1MB (LMD) and the factory setting is 1K? I would expect 1MB since this is the maximum heap size that all the Symbian Signed applications should use for start up.
Looking forward to receiving your answer.
Thanks Panayotis