Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cu): transfer memory between worker and main thread #835

Merged
merged 2 commits into from
Jul 24, 2024

Conversation

TillaTheHun0
Copy link
Member

@TillaTheHun0 TillaTheHun0 commented Jun 28, 2024

This PR makes it so that the CU will transfer the ArrayBuffer representing an ao process' memory between the main thread and worker thread. This in lieu of a structured clone being performed on the ArrayBuffer across threads -- the default behavior of comms via a MessageChannel.

This should reduce the evaluation times for all processes, but particularly processes with large memory foot prints. Additionally, this also circumvents an existing NodeJS bug that prevent structured cloning an ArrayBuffer >4GB.

@TillaTheHun0
Copy link
Member Author

There seems to be an issue with ArrayBuffers piling up in the heap. Need to figure out if there's a place where an ArrayBuffer out to be dereferenced and subsequently garbage collected.

@TillaTheHun0
Copy link
Member Author

TillaTheHun0 commented Jun 30, 2024

See #837 for memory leak fix. This PR should hold until that one is merged.

@TillaTheHun0 TillaTheHun0 force-pushed the tillathehun0/cu-transfer-memory branch 4 times, most recently from 344b74e to f047ea9 Compare July 3, 2024 13:43
@TillaTheHun0 TillaTheHun0 force-pushed the tillathehun0/cu-transfer-memory branch 4 times, most recently from 8af0b33 to f7ce814 Compare July 22, 2024 14:48
@TillaTheHun0 TillaTheHun0 force-pushed the tillathehun0/cu-transfer-memory branch from f7ce814 to aec5aaa Compare July 23, 2024 17:30
@TillaTheHun0 TillaTheHun0 force-pushed the tillathehun0/cu-transfer-memory branch from aec5aaa to 4b17762 Compare July 24, 2024 14:29
@TillaTheHun0 TillaTheHun0 merged commit ce960a6 into main Jul 24, 2024
3 checks passed
@TillaTheHun0 TillaTheHun0 deleted the tillathehun0/cu-transfer-memory branch July 24, 2024 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant