×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Nov 2004
    Location
    minsk
    Posts
    432

    Question Z_MEM_ERROR while calling compress in openC

    Hi
    Im getting Z_MEM_ERROR (-4) attimes when calling compress (zlib) in symbian app I wonder why this is happening it doesnot happen always if the buffer is large like 30k it fails but not always, can I prevent this somehow ? by increasing epocstacksize/ epocheapsize?

    Is 30k too huge to be allocated on heap i dont think so !

  2. #2
    Regular Contributor
    Join Date
    Nov 2004
    Location
    minsk
    Posts
    432

    Re: Z_MEM_ERROR while calling compress in openC

    and I also noted if the app failed with -4 , It can work with same amount of data after a restart , does it mean that memory is getting fragmented? In that case how can Increasing the heapsize help ? at some point fragmentation can occur again right?
    Symbian should take care of maintaining memory fragmentation right?

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Z_MEM_ERROR while calling compress in openC

    I do not know zlib/Z_MEM_ERROR, but -4 in the general Symbian C++ context is indeed KErrNoMemory.
    Fragmentation of your own heap can not be addressed by the operating system, it is not a managed environment like Java or .Net.

  4. #4
    Regular Contributor
    Join Date
    Nov 2004
    Location
    minsk
    Posts
    432

    Re: Z_MEM_ERROR while calling compress in openC

    If user heap memory fragmentation is not managed by Os then even if I give larger heap my app will encounter same issue after a while right? So how to make apps run for months?

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: Z_MEM_ERROR while calling compress in openC

    The memory usage pattern of the application matters a lot. Fragmentation is an existing thing, it is not that easy to end up with severely fragmented memory.
    It might be a good idea to check User::Available and User::CountAllocCells when you start encountering problems.

Similar Threads

  1. How To compress SIS file?
    By kusumat in forum Symbian
    Replies: 11
    Last Post: 2009-10-05, 09:27
  2. COmpress Xml
    By ansh.chauhan in forum Mobile Java General
    Replies: 6
    Last Post: 2009-06-12, 14:10
  3. An Example of Sending compress SMS ?
    By naoriya in forum General Messaging
    Replies: 2
    Last Post: 2009-02-13, 12:53
  4. Replies: 2
    Last Post: 2008-06-24, 12:09
  5. compress & SMS
    By kokoadi in forum Symbian
    Replies: 4
    Last Post: 2007-12-26, 05:10

Posting Permissions

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