Skip to content

Adds memory guard - #35

Merged
erp12 merged 5 commits into
masterfrom
mem-guard
Apr 22, 2026
Merged

Adds memory guard#35
erp12 merged 5 commits into
masterfrom
mem-guard

Conversation

@erp12

@erp12 erp12 commented Jan 25, 2026

Copy link
Copy Markdown
Owner

Adds a memory guard to all functions in the function set that can grow the size of a value. The guarded functions throw an exception if the returned value exceeds the hardcoded threshold of 50 KiB.

Also adds and evolutionary statistic that counts the number of individuals per generation that exceed the memory guard on at least one case.

This feature is implemented with clj-memory-meter which requires the jvm-opt -Djdk.attach.allowAttachSelf to be set. This has been added to this project's aliases that are used to run tests and benchmark runs but users that run cbgp-lite as a library will need to set the jvm-opt themselves.

This PR has been tested on a small number of runs for count-odds, get-vals-of-key, and sum-vector-vals.

@erp12
erp12 requested a review from thelmuth January 25, 2026 06:00
@erp12
erp12 merged commit 5db3fca into master Apr 22, 2026
2 checks passed
@erp12
erp12 deleted the mem-guard branch April 22, 2026 20:22
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