×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    18

    getting error memory full

    Hello All,
    when I call listbox in my app it shows error Memory full, closed some application.
    I searched it on net but nothing found fruitful.
    Kindly help me.
    Thank You.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,566

    Re: getting error memory full

    Note that your application has 1 megabyte of memory by default. With complex UI and/or lots of data (in a list for example) it is easy to run out of it. EPOCHEAPSIZE is the keyword in the .mmp file which allows you increasing the memory limit. The interactive .mmp editor of Carbide.c++ also has a box for it somewhere, perhaps on the 2nd or 3rd page.
    If you feel that the error message is misleading, you are right: closing other applications usually does not help in this situation.

  3. #3
    Registered User
    Join Date
    May 2012
    Posts
    18

    Re: getting error memory full

    is it possible that my list box is not created due this reason???
    in constructl i do as following:

    iItemList = new (ELeave) CAknDoubleGraphicStyleListBox();//CAknSingleGraphicStyleListBox();//CAknSingleStyleListBox();// GraphicStyleListBox();

    iItemList->SetContainerWindowL(*this);
    iItemList->SetMopParent(this);
    iItemList->ConstructL(this,EAknListBoxSelectionList | EAknListBoxLoopScrolling);
    iItemList->CreateScrollBarFrameL(ETrue);
    // iItemList->SetListBoxObserver(this);
    // iItemList->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    // //Force any scroll bars and the corner window if it is visible to be redrawn
    // iItemList->ScrollBarFrame()->DrawScrollBarsNow();
    // // UpdateScrollBar(iItemList);
    // iItemList->UpdateScrollBarsL();

    SetRect(aRect);
    //SetRect(iEikonEnv->EikAppUi()->ClientRect());
    ActivateL();
    iItemList->MakeVisible(true);

    and there is another method call substring
    in which i read file and getting # separated value in various array


    SubString()
    {
    TInt size=0;
    TBuf<20> msg(_L("In Substring"));
    // iEikonEnv->AlertWin(msg);
    TInt pos=0;
    TFileName filename;
    filename.Copy(KFileSpec);
    TInt err = CCoeEnv::Static()->FsSession().MkDirAll(filename);

    //
    // //This path is mapped as: C:\Symbian\8.0a\S60_2nd_FP2\epoc32\wins\c\System\Test.txt

    RFs iFs;
    iFs.Connect();
    RFile iFile;

    if ((KErrNone != err) && (KErrAlreadyExists != err))
    {
    return;
    }
    // TBuf8<200>
    TInt iErr=iFile.Open(iFs,KFileSpec,EFileRead);
    iFile.Size(size);
    if(iErr==KErrNone)
    {
    HBufC8* FileData8 = HBufC8::NewL(size);
    TPtr8 ptr= FileData8->Des();
    iFile.Seek(ESeekStart, pos);
    iFile.Read(pos,ptr);

    // iFile.Read(pos,ptr);
    TPtr8 pt = FileData8->Des();
    Demobuf = pt.AllocLC();
    delete FileData8;
    // CleanupStack::Pop(FileData8);
    iFile.Close();
    }

    iFs.Close();
    TBuf<200>ibuf, ibuf1;
    TInt iHashPos, ihaspos1;
    TBuf16<30> Temp16;
    TBuf<100>itemp;
    TBuf<100>itemp1;
    TBuf<100>itemp11;
    TBuf<100>itemp2;
    TBuf<100>itemp3;
    TBuf<100>itemp4;
    TInt count = 0;

    array = new (ELeave) CDesCArrayFlat(1);
    datetimearray = new (ELeave) CDesCArrayFlat(1);
    titlearray = new (ELeave) CDesCArrayFlat(1);
    titlearray1 = new (ELeave) CDesCArrayFlat(1);
    stringarray = new (ELeave) CDesCArrayFlat(1);
    favarray = new (ELeave) CDesCArrayFlat(1);

    // ibuf.Copy(Demobuf);//_L("aaa#bbb#ccc#ddd#aa#bb#cc#ddddd#"));
    TPtr8 pt = Demobuf->Des();


    do{
    // iHashPos = ibuf.Find(_L("##"));
    iHashPos = pt.Find(_L8("##"));
    if(iHashPos>=0)
    {
    itemp.Copy(pt.Mid(0,iHashPos));//ibuf
    array->AppendL(itemp);
    ibuf.Delete(0,iHashPos+1);
    // listbox();
    ibuf1.Copy(itemp);
    count=0;
    do{
    ihaspos1 = ibuf1.Find(_L("#"));
    count = count+1;
    if(ihaspos1>=0)
    {
    if(count==1)
    {
    itemp1.Copy(ibuf1.Mid(0,ihaspos1));
    datetimearray->AppendL(itemp1);
    }
    if(count==2)
    {
    itemp2.Copy(_L("\t"));
    itemp2.Append(ibuf1.Mid(0,ihaspos1));
    itemp11.Copy(ibuf1.Mid(0,ihaspos1));
    // itemp2.Append(itemp1);
    // itemp2.Append(ibuf1.Mid(0,ihaspos1));
    itemp2.Append(_L("\t\t"));

    // array3->AppendL(itemp3);

    titlearray->AppendL(itemp2);
    titlearray1->AppendL(itemp11);
    }
    if(count==3)
    {
    itemp3.Copy(ibuf1.Mid(0,ihaspos1));
    stringarray->AppendL(itemp3);
    }
    if(count==4)
    {
    size++;
    itemp4.Copy(ibuf1.Mid(0,ihaspos1));
    favarray->AppendL(itemp4);
    }
    ibuf1.Delete(0,ihaspos1+1);
    }
    }while(ihaspos1>=0);

    }
    }while(iHashPos>=0);

    loadinglist();
    }

    in loadinglist
    loadinglist()
    {
    // TBuf<256> msg(_L("In loadinglist"));
    // iEikonEnv->AlertWin(msg);
    iItemList->Model()->SetItemTextArray(titlearray);


    iItemList->SetListBoxObserver(this);
    iItemList->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    //Force any scroll bars and the corner window if it is visible to be redrawn
    iItemList->ScrollBarFrame()->DrawScrollBarsNow();
    // UpdateScrollBar(iItemList);
    iItemList->UpdateScrollBarsL();


    iItemList->Model()->SetOwnershipType(ELbmOwnsItemArray);
    iItemList->SetCurrentItemIndex(0);
    iItemList->SetFocus(ETrue);
    iItemList->HandleItemAdditionL();
    }
    kindly help me.

  4. #4
    Nokia Developer Expert
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,140

    Re: getting error memory full

    Basically you might want to check that all things that you construct will also be deleted, currently it looks that some CDesCArrayFlat might not be deleted, though its not really easy to see from the code.

  5. #5
    Registered User
    Join Date
    May 2012
    Posts
    18

    Re: getting error memory full

    dear yucca,
    if I delete CDescArrayFlat...
    dosent help me:(:(

  6. #6
    Nokia Developer Expert
    Join Date
    Sep 2011
    Posts
    382

    Re: getting error memory full

    One wat would be to optimise the stack (size) vs. heap descriptors. The easiest way to detect problems from that is to comment out some of the TBufs to see does it resolve the memory problems and then convert them to heap descriptors.

Similar Threads

  1. Memory full error
    By darshan.gandhi in forum Symbian C++
    Replies: 7
    Last Post: 2009-06-10, 10:43
  2. Memory full error on E71
    By pranay_preet in forum Symbian C++
    Replies: 9
    Last Post: 2009-02-16, 12:51
  3. Memory full error
    By raj_rr7 in forum Symbian C++
    Replies: 1
    Last Post: 2008-07-09, 12:28

Posting Permissions

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