Another strategy is to have these "objects" be a record in a database, instead
of having an array in memory. The access will be slower but you can have more
records and if this is some sort of reference, it belongs in a database
anyhow.
Neil Davidson wrote:
> 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