Skip to content

Conversation

@AnsisMalins
Copy link
Contributor

@AnsisMalins AnsisMalins commented Oct 23, 2025

Second attempt at achieving zero unsolicited allocations in fast args. First attempt: #685

@smokeelow
Copy link

smokeelow commented Oct 24, 2025

hm, looks like something i need for my use case

i'm working on e-commerce framework with scripting capabilities via ClearScript and i see extreme memory leaks when scripts executed under high load

unmanaged memory grows to infinity with each execution ( i use FastProxy way)

@ClearScriptLib
Copy link
Collaborator

Hi @AnsisMalins,

This is an interesting change. Comments/questions:

  • We weren't aware of ArrayPool. Nice find! "Rental" is presumably slower than allocation, but if it isn't a big hit, it's probably worth it, though we'd prefer to create a private pool (ArrayPool<T>.Create) instead of using the shared one.
  • We don't understand the V8FastArg change. Since every method calls GetObject, the only improvement is to the case in which no methods are called – that is, the case in which the callback ignores the argument. That's OK, but (a) that's probably not the improvement you were looking for, and (b) the holder pool seems like overkill, as you could simply use a normal object reference and a bool to track whether it's been initialized.
  • We aren't seeing any changes in V8FastArgImpl.cs. Are there none?

Thanks!

@ClearScriptLib
Copy link
Collaborator

Hi @smokeelow,

unmanaged memory grows to infinity with each execution

That's definitely concerning, and we'd love to help you get to the bottom of it, but this change affects only managed memory. If you can provide any details about the leaks you're seeing, please create a new issue.

Thanks!

@smokeelow
Copy link

Hi @smokeelow,

unmanaged memory grows to infinity with each execution

That's definitely concerning, and we'd love to help you get to the bottom of it, but this change affects only managed memory. If you can provide any details about the leaks you're seeing, please create a new issue.

Thanks!

will create an issue today with snapshots etc.

thanks!

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