Skip to content

Conversation

@mdogan
Copy link
Contributor

@mdogan mdogan commented Oct 27, 2025

No description provided.

Implemented a memory allocation tracking feature that allows measure and limit
heap allocations, useful for preventing out-of-bounds memory usage in
sandboxed environments.

- SetMemoryLimit(bytes): Configure maximum heap allocation limit
- GetAllocatedBytes(): Query current tracked memory usage
- ResetMemoryUsage(): Reset allocation counter

Tracked allocation paths:
- Table allocations (array and hash parts, growth/resizing)
- String operations (concat, rep, format, gsub, etc.)
- Function/closure allocations
- VM registry growth
@mdogan mdogan force-pushed the improvement/memory-tracking branch from 7102826 to 4ea0c6b Compare October 27, 2025 16:30
@mdogan mdogan closed this Oct 27, 2025
@mdogan mdogan deleted the improvement/memory-tracking branch October 27, 2025 20:53
@mdogan mdogan restored the improvement/memory-tracking branch October 27, 2025 21:26
@mdogan mdogan changed the title Feature: Track and limit heap memory allocations Closed - Accidentally created PR Oct 27, 2025
@mdogan mdogan deleted the improvement/memory-tracking branch October 28, 2025 12:24
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