Stuck with malloc failed error

7 posts / 0 new
Last post
hussainjamali
hussainjamali's picture
Offline
Joined: 15 Apr 2010
Posts:
Stuck with malloc failed error

i have not wrote much c++ program..
so stuck with memory allocation error...
So plz suggest me.....
how to use variable and allot the memory
and deallocate memory , so i can dig myself out of these malloc errors...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

This normally occurs when you start a new project, and you've not changed the (very low) default memory settings. It is easily fixed. In Eclipse, right-click the project, and select Properties. Open 'MoSync Project', and 'Build Settings'. Select the 'Compiler Flags' tab, and you can enter new settings. The values you choose will ultimately be down to the target platform, but during development, you can set them to whatever values you want (within reason). For this example, I've chosen a heap size of 256k, a stack size of 128k and a data size of 512k.

[attachment=0]MoSync settings.png[/attachment]

MoSync settings.png
hussainjamali
hussainjamali's picture
Offline
Joined: 15 Apr 2010
Posts:

Hey thanks....

its fine for development time..
Is it going to bother me on actual device?????

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

It depends on the device. If you set it so that it need 2Mb, then you're not going to have too many phones which it will work on. I find that 512k is good on most phones, but it depends on your market. Do you have any target phones in mind?

hussainjamali
hussainjamali's picture
Offline
Joined: 15 Apr 2010
Posts:

yeah i want to know about motorola l7 or nokia 2626..
Is it going to it on??

Sam Pickard
rival's picture
Offline
Mobile Archmage
Joined: 19 Mar 2009
Posts:

I've not got an L7 anymore (lost it on a plane), but I've got a V3x and PEBL. I'll try them out and let you know. In the meantime, keep coding!

hussainjamali
hussainjamali's picture
Offline
Joined: 15 Apr 2010
Posts:

ohh sad...
god give u strength to bear the loss

thanks for help
plz do let me know