×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    May 2007
    Posts
    22

    Why (Big chunk) Malloc Failure in Symbian?

    I have observed Symbian Heap allocator failing when application trying to allocate big chunk of memory ( 4K, 8K, 10 etc). I cross-checked total system memory availability and found memory more than 3.7 MB RAM is free in the device (when malloc failure happens). I assume dynamic memory usage not yet crossed expected heap size.

    I have following instruction in mmp file for customize Heap size
    EPOCHEAPSIZE 1048576 2097152

    I am unable to find an API to check memory usage for the application ( or current process). Does Symbian supports such an API?

    Googleing this issue further, I found Symbian Heap allocator may be using an inefficient heap allocator algorithm ( ftp://bells.cs.ucl.ac.uk/functional/...roject.pdf.gz).

    This article has an interesting finding, Symbian heap allocator has 65% internal fragmentation. But this is an old story, must be resolved in Symbian 3rd edition. ( I am using a 3rd edition device (N91) for my testing).

    Do anybody face(ing) such issues with Symbian 3rd Edition phones? What is the appropriate method to avoid such memory failures. Please avoid suggestions like static memory. For example SIP stacks like osip, will do extensive dynamic allocation. This is an appropriate design and Symbian does not de-motivate the usage of Heap.

    Bino George
    IM: a_binogeorge@yahoo.com a.binogeorge@gmail.com
    Mobile: +91-98861-74374

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: Why (Big chunk) Malloc Failure in Symbian?

    Quote Originally Posted by a_binogeorge
    I have observed Symbian Heap allocator failing when application trying to allocate big chunk of memory ( 4K, 8K, 10 etc). I cross-checked total system memory availability and found memory more than 3.7 MB RAM is free in the device (when malloc failure happens). I assume dynamic memory usage not yet crossed expected heap size.
    Yes i also faced same Problem in past With Symbian v9 devices. Seams like fragmentation issue has not Fixed By V9.

  3. #3
    Registered User
    Join Date
    May 2007
    Posts
    22

    Re: Why (Big chunk) Malloc Failure in Symbian?

    In Symbian OS Internals ( Section: 7.5.2: Free Store Allocators and Heaps), provides details about Symbian default alloctor (RHeap).

    Default RHeap is defined as 'First fit, Address Ordered, Free List Allocator".

    RHeap Allocation Algorithm
    ---------------------------------------
    "The allocation algorithm searches the free list from the start until a
    block is found that is large enough to satisfy the request. If the allocator
    finds such a block, the allocator splits the free block into the requested
    allocated block and any remaining free space, which is kept on the free
    list.
    Sometimes the block is only just large enough for the request (or the
    remaining space is too small to keep on the free list) in which case the
    whole block is returned by the request. If there is no free block large
    enough, the allocator tries to extend the chunk to create a larger free
    block at the end of the heap to satisfy the request".

    This algorithm looks decent and can not produce any pathological internal fragemenation.

    Can Symbian allocator, when trying to extend the chunk, return a NULL?

    Any input?

Similar Threads

  1. 7650 Symbian Connect
    By alexbas in forum Symbian Tools & SDKs
    Replies: 4
    Last Post: 2008-11-16, 10:40
  2. Symbian C++ or MDIP: some newbie questions
    By sgalmeida in forum Symbian
    Replies: 2
    Last Post: 2006-12-30, 08:57
  3. A little survey regarding Java vs Symbian C++
    By Olnex in forum Mobile Java General
    Replies: 0
    Last Post: 2006-11-01, 09:00
  4. Symbian 6.1 SDK generates Java asserion failure
    By svalexandroff in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-10-10, 14:57
  5. Replies: 0
    Last Post: 2003-06-13, 01:09

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×