Open forchid opened 2 weeks ago
Seems ORC-only. refc
doesn't seem affected.
This code is basically a pure stress test of the cycle collector. The segfault is probably a legitimate issue but there are some tips I would give to improve the performance on ORC, and do work around this issue.
parent
as {.cursor.}
. This alone works around the issue, but it's still not super fast and the occupied memory caps at exactly 400 MiB. Doing this along with marking ObjRef
as {.acyclic.}
drops the occupied memory to 320 bytes. Weirdly enough, not using {.cursor.}
but still marking as {.acyclic.}
/using ARC also works, but it would probably segfault if parent
was read from.{.cursor.}
, disable the cycle collector via GC_disableOrc()
and only run it a few times during the loop via GC_runOrc()
. This gives worse performance than the above but also works around the issue.The fact that ObjRef
uses inheritance isn't related.
- Weirdly enough, not using
{.cursor.}
but still marking as{.acyclic.}
/using ARC also works,
@metagn This test actually hasn't cyclic refs for these cyclic relationships broken manually.
The parent and children are mutually cyclic with each other. If the parent is not marked {.cursor.}, when the child is destroyed, the parent is destroyed as well. This normally causes issues but it's not encountered in this test, if that's what you meant.
Description
Test source
Nim Version
active boot switches: -d:release
Current Output
Expected Output
Known Workarounds
No response
Additional Information
No response