"Not enough heap memory"


Author Message
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3751
Posted: 12:38pm 02 Apr 2026      

Thanks for looking into it. Perhaps a solution will make itself known.

The problem as I see it is the array sizes set by MAX_RECS. The number of variables doesn't seem to be an issue if MAX_RECS is small enough.

These arrays of structures chew up a lot of heap.
Dim IndexItemNum DB_IndexNum(MAX_RECS)  ' a structure, size 16
Dim IndexItem DB_Index(MAX_RECS)        ' a structure, size 40
Dim IndexItem DB_Lookup(MAX_RECS)       ' a structure, size 40
Dim IndexItemNum DB_LookupNum(MAX_RECS) ' a structure, size 16
Dim IndexItem Result_List(MAX_RECS)     ' a structure, size 40


For MAX_RECS of 1000, that would be about 150K. I'd like for MAX_RECS to be a maximum of 2000.

If there were a way to make sure they went into PSRAM, it would probably solve the problem.

Something like Dim PSRAM IndexItem DB_Index(MAX_RECS) might do it.

~
Edited 2026-04-02 22:44 by lizby