Main Site Documentation

Out of memory exception in Hydra


#1

Hi,

i try to allocate int array of 216000 ints and get “out of memory exception”. any idea?
Did someone see it?

i am using Hydra with 4.2 framework…


#2

216000 * 8 (bytes per int) = ~1.648M; you may not have that much contiguous RAM available. Try using a LargeBuffer: http://wiki.tinyclr.com/index.php?title=Custom_Heap or make sure you’re not eating up your RAM elsewhere


#3

Custom heap functions were removed from 4.2


#4

LargeBuffer class still applies, the size of the custom heap is now static ally defined in the firmware any you can nolonger programmatically adjust the custom heap size.


#5

4MB is the current set custom heap size.

LargeBuffer is still available.


#6

@ andre.m - I am not at my PC so I can’t point to the exact location, but you should be able to see the size in the linker scatter file iirc.


#7

I also recommend to force GC run before trying to allocate big chunk of memory.


#8

CustomHeap is not affected by GC. You must properly dispose of it yourself according to the docs.


#9

That was more of a general advise.