Log In  

The following code runs fine:

function _init()
  local array = {}
  for x = 1,8192 do
    array[x] = {}
  end
  for x = 1,8192 do
    foreach({},nil)
  end
end

If I change the foreach line to

  foreach(array[x],nil)

I get an out of memory error. This suggests to me that indexing the array allocated memory. The memory appears to be garbage collected eventually; if I use a smaller array and put the code in _update, I don't see any error.

P#12736 2015-08-17 13:16 ( Edited 2015-08-17 17:16)


[Please log in to post a comment]