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

Call malloc_trim(3) Before Reload to Release Unused Memory🧠 #10302

Open
Al2Klimov opened this issue Jan 14, 2025 · 0 comments
Open

Call malloc_trim(3) Before Reload to Release Unused Memory🧠 #10302

Al2Klimov opened this issue Jan 14, 2025 · 0 comments

Comments

@Al2Klimov
Copy link
Member

Is your feature request related to a problem? Please describe.

Currently, memory that has been allocated and not released is often retained by the current process. While this can benefit the same process when it mallocs more memory (re-usage), it doesn't help other processes, including a new main process during a reload. As a result, the system may be inefficient in terms of memory utilization across reloads.

Describe the solution you'd like

Before every reload attempt, the main process should call malloc_trim(3) if available to release unused memory back to the system. This would allow the system to free up memory that may no longer be needed, helping with overall memory efficiency and preventing wasted space for other processes, including newly spawned ones.

Describe alternatives you've considered

Additional context

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

No branches or pull requests

1 participant