Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 2, 2025

Summary

Updated the garbage collector documentation to properly document the default 75% memory limit behavior in container environments:

  • Updated the "Heap hard limit percent" section to clarify that in memory-constrained environments (containers), the container limit is considered the total physical memory, and the default value is 75%
  • Updated the "Heap hard limit" section to reference the "Heap hard limit percent" section for the default value, instead of duplicating the 75% information

This centralizes the default percentage documentation in one place (GCHeapHardLimitPercent) and references it from the GCHeapHardLimit section, avoiding potential confusion about how the values interact.

Original prompt

This line

If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or 75% of the memory limit on the container.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Internal previews

📄 File 🔗 Preview link
docs/core/runtime-config/garbage-collector.md docs/core/runtime-config/garbage-collector

Copilot AI changed the title [WIP] Set default memory limit for constrained environments Document default 75% value for GCHeapHardLimitPercent in container environments Dec 2, 2025
Copilot AI requested a review from agocke December 2, 2025 23:45
Copilot finished work on behalf of agocke December 2, 2025 23:45
@agocke
Copy link
Member

agocke commented Dec 2, 2025

@copilot I believe this would read better as:
Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the total physical memory is the memory limit; otherwise it's what's available on the machine.

@agocke
Copy link
Member

agocke commented Dec 2, 2025

@copilot I believe this would read better as:
Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, the container limit is considered the total physical memory. If in a memory-constrained environment, the default value is 75%.

Copy link
Contributor Author

Copilot AI commented Dec 2, 2025

@copilot I believe this would read better as:
Specifies the heap hard limit as a percentage of the total physical memory. If the process is running in a memory-constrained environment, that is, inside...

Updated the wording as suggested in commit f552eb5.

Copilot finished work on behalf of agocke December 2, 2025 23:54
Copy link
Member

@agocke agocke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please address


- The heap hard limit is defined as the maximum commit size, in bytes, for the GC heap and GC bookkeeping.
- This setting only applies to 64-bit computers.
- If this limit isn't configured but the process is running in a memory-constrained environment, that is, inside a container with a specified memory limit, a default value is set. That default is the greater of 20 MB or 75% of the memory limit on the container.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually not sure this is correct. If this were true, then setting GCHeapHardLimitPercent to, say, 90% inside of a container would be equal to .75 * .9 * x = .675x, but it's actually .9x. I think we should instead note that inside a container the GCHeaphardLimitPercent has a different default value (and point to that section)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated line 303 to reference the heap hard limit percent section instead of duplicating the 75% value. This centralizes the default value documentation in GCHeapHardLimitPercent and clarifies the relationship. Commit d6dd0eb.

Copy link
Contributor Author

Copilot AI commented Dec 3, 2025

@copilot please address

Addressed in commit d6dd0eb. Updated the GCHeapHardLimit section to reference the GCHeapHardLimitPercent section for the default value, rather than duplicating the 75% information.

Copilot AI requested a review from agocke December 3, 2025 21:17
Copilot finished work on behalf of agocke December 3, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants