Skip to content

Conversation

@mdogan
Copy link
Owner

@mdogan mdogan commented Oct 27, 2025

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

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 merged commit 4ea0c6b into master Oct 28, 2025
16 checks passed
@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.

3 participants