Neil -
Yes, this could definately be the problem - heap memory is very limited
under the PalmOS. Depending on which version you're running, you could have
less than 10Kb total heap memory to work with which includes all globals,
static variables, string literals (if you don't have "PC Relative Strings"
set), and your dynamic memory allocations.
One suggestion is to rethink your Film class as shown below. Every time you
instantiate a Film object, you're sucking up >600 bytes from the heap even
when you may only use a small portion of this (I'm assuming this is the
case - what's the 500 bytes of director for?).
Try dynamically allocating the name, star1, star2 and director fields in
your class' constructor if you can (but only the amount needed to hold this
information). See what happens then...
Stu.
> -----Original Message-----
> From: Neil Davidson [mailto:[EMAIL PROTECTED]]
> Sent: Monday, March 01, 1999 2:28 PM
> To: [EMAIL PROTECTED]
> Subject: Possible memory problems?
>
>
> Hi guys,
>
> I had a few problems with my mailer over the weekend so I don't know if
> anyone replied to my post. Sorry to have to repeat it.....
>
>
> I (thought I had) finished my uni project, but I have come across a
> problem, and I think it is to do with the size of the dynamic heap.
>
> When my app is launched it creates a dynamic data structure, an array of
> 'Films', which is a class in my code that looks like this :
>
> class Film{
> Boolean visible;
> char name[50];
> int yearOfRelease;
> enum Cert certificate;
> enum Genre genre;
> int rating;
> char star1[50];
> char star2[50];
> char director[500;
> }
>
> The two enumerated types just have 4 or 5 values, and the are also three
> simple methods.
>
> It would appear that the app works fine when the data structure holds 13
> instances of the class, but any more than that crashes the app. I don't
> know much about the OS and memory etc; does this sound like a problem with
> the heap?
>
> If it is then is there any way round it? I didn't think memory would be a
> problem with that size of data set.
>
> Thanks,
>
> Neil
>
>
>