Summary
This could either be a weak_map issue or a garbage collector issue
c.f. Weak maps don't hold weak references??
c.f. Classes never garbage collected?
Please select what you are reporting on:
Verse
What Type of Bug are you experiencing?
Stability
Steps to Reproduce
using { /Fortnite.com/Devices }
using { /Verse.org/Simulation }
unique_object := class<unique>:
MemoryIntensiveArrays : [][]float
test_weak_maps := class(creative_device):
var SomeWeakMap : weak_map(unique_object, logic) = map{}
# var SomeWeakMap : [unique_object]logic = map{}
OnBegin<override>()<suspends>:void=
HugeFloatArray := for(__ := 0..1000000) {0.123456789} # Should be passed by copy as every array do
for(I := 1..10000):
NewObject := unique_object:
MemoryIntensiveArrays := array:
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
HugeFloatArray
option{set SomeWeakMap[NewObject] = true}
Print("Itration({I})")
Sleep(0.0)
# NewObject should be removed by garbage collector here?
Expected Result
Server shouldn’t crash (see repro)
Observed Result
Server crashes (see repro)
Platform(s)
PC