Relative Content

Tag Archive for arrayslinuxgo

Error allocating max uint32 amount of memory

I need to allocate a max uint32 worth of memory to an array with go but I am getting an error: fatal error: runtime: out of memory. I want to index into the array using a uint32 to manage all possibilities for a given computation that returns a 32 bit index. That I know of, an array of this size should be 4GB in size, give or take a small factor for how big the array entries are. I already checked ulimit, and it is not the source of error. My machine has 16 GB of ram, so there should be enough for this large allocation. This is the start of a project that will later scale to hundreds of gigabytes in memory.