×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    46

    Is big array acceptable for symbian.

    In my application, I have some very big arrays which used as look-up tables.
    I define them within a class, as follows:

    class MyData
    {
    public:
    MyData();
    ........

    private:
    TUint8 iData1[16][1024][16];
    TUint8 iData2[16][1024][16];
    TUint8 iData3[16][1024][16];
    };

    Is it OK to write them as above under symbian?

  2. #2
    Registered User
    Join Date
    Mar 2010
    Posts
    29

    Re: Is big array acceptable for symbian.

    It1s only 6 kb, when your stack size is big enough it will working. I think you can use RArray, with that it will work fine.

  3. #3
    Registered User
    Join Date
    Sep 2010
    Posts
    46

    Re: Is big array acceptable for symbian.

    I think it's 256KB for each.
    In fact , these data is constant. I build it in the run time just because it's difficult to edit it in the source code.
    It seems that symbian supports global constant, but one thing I don't understand well is that Whether the global constant
    is store in stack or somewhere else.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: Is big array acceptable for symbian.

    You should allocate that object on the heap, it is 768kB.
    If you want to do that directly, you may want to call your class CMyData and inherit it from CBase. This way your arrays are going to be initialized with zeroes, which can be useful.
    You can also call it TMyData, and use it as a value type, for example as member of C-objects.
    Note that the default maximum size of the heap is 1MB, if you want to have multiple instances of that object, you will have modify the heap size (EPOCHEAPSIZE keyword in the .mmp, Carbide.c++ has a setting for it too).

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

    Re: Is big array acceptable for symbian.

    Quote Originally Posted by is03zong View Post
    It seems that symbian supports global constant, but one thing I don't understand well is that Whether the global constant
    is store in stack or somewhere else.
    Since it has a constructor, it does not exactly behave as a global constant. And having very large global variables may cause mysterious linker errors about "overlapping regions".

  6. #6
    Registered User
    Join Date
    Sep 2010
    Posts
    46

    Re: Is big array acceptable for symbian.

    I think I should rewrite a lot of code to eliminate these datas, or my application will be hightly risky running in symbian.
    768KB is too large for symbian.
    Even the size of the whole memory is big, but for single application, it's very limited, considering the MAX_STACK_SIZE and MAX_HEAP_SIZE.
    Last edited by is03zong; 2010-10-19 at 17:22.

  7. #7
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,674

    Re: Is big array acceptable for symbian.

    I have never heard about MAX_HEAP_SIZE. Neither I have found such constant in an S60 3rd FP1 SDK
    A Google search indicates that it may be some limitation to Java virtual machines, obviously nothing to do with your Symbian C++ code.
    You can use as much memory as available on the device. Since it varies between devices, some applications even construct their own heap in runtime, like the Font and Bitmap Server. However you should rather estimate your requirements and specify a few megabytes.

Similar Threads

  1. OVI store billing one big fun, one big not working black bole
    By xlazom00 in forum [Closed] Publishing to Nokia Store
    Replies: 2
    Last Post: 2010-08-12, 20:16
  2. Why Big chunk Malloc Failure in Symbian?
    By a_binogeorge in forum Symbian
    Replies: 12
    Last Post: 2007-08-15, 09:13
  3. Why (Big chunk) Malloc Failure in Symbian?
    By a_binogeorge in forum Symbian
    Replies: 2
    Last Post: 2007-05-10, 07:28
  4. initializing a big array
    By Bkc82 in forum Symbian
    Replies: 6
    Last Post: 2006-04-18, 00:57

Posting Permissions

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