Currently, the VM will allocate a new stack of 262144 bytes (256kb). This makes actors very expensive in terms of memory usage. The default stack allocation size should be lowered, since the stack sizes for actors will generally be much lower than seen in a typical PHP application.
I have a patch for this, but it causes heap corruption issues for some reason:
Strangely enough, 256 bytes causes a few test failures (such as the actor-cleanup-on-shutdown.phpt test) with a heap corruption issue, and 512 bytes causes the context-switching-basics3.phpt test to fail with a segfault. Using 64, 128, 1024, 2048, etc, bytes seems to work fine. This needs some investigation before it gets changed.
The heap corruption bug has been fixed in 008f0c7de9d1bda832aaeea2e398608dc6bd61e6 and the default VM stack size of an actor has been changed to 256 bytes in 81e0bec14cb9d9984d678d85d3ef3f8c74b07712.
Currently, the VM will allocate a new stack of 262144 bytes (256kb). This makes actors very expensive in terms of memory usage. The default stack allocation size should be lowered, since the stack sizes for actors will generally be much lower than seen in a typical PHP application.
I have a patch for this, but it causes heap corruption issues for some reason:
Strangely enough, 256 bytes causes a few test failures (such as the
actor-cleanup-on-shutdown.phpt
test) with a heap corruption issue, and 512 bytes causes thecontext-switching-basics3.phpt
test to fail with a segfault. Using 64, 128, 1024, 2048, etc, bytes seems to work fine. This needs some investigation before it gets changed.