You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the report. This was accurate when it was opened: Subprocess.resourceUsage().maxRSS returned the raw ru_maxrss value, which is kilobytes on Linux (and PeakWorkingSetSize / 1024 on Windows) but bytes on macOS, so on Linux the documented unit was wrong.
It was fixed on the implementation side instead. Since #36087, src/spawn_sys/spawn_process.rs normalizes the value to bytes on every platform: ru_maxrss is multiplied by 1024 on non-Apple targets, and the Windows path stores PeakWorkingSetSize without dividing it. A quick check with a current build: for the same child process, process.resourceUsage().maxRSS inside the child reports 26964 (kilobytes, as in Node) and the parent's proc.resourceUsage().maxRSS reports 27611136, exactly 1024 times that. test/harness.ts also asserts the bytes unit now.
So the current docs (docs/runtime/child-process.mdx, which replaced docs/api/spawn.md in #24201) and the ResourceUsage.maxRSS JSDoc in packages/bun-types/bun.d.ts are correct as written, and changing them to kilobytes would now be wrong. Closing this one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docsImprovements or additions to documentationtypesAn issue with TypeScript types
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
ResourceUsage.maxRSS is reported in kilobytes. See libuv api documentation.