Skip to content

Add Windows memory tracking support using psutil#6233

Open
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/windows-memory-tracking
Open

Add Windows memory tracking support using psutil#6233
veeceey wants to merge 1 commit intojina-ai:masterfrom
veeceey:fix/windows-memory-tracking

Conversation

@veeceey
Copy link

@veeceey veeceey commented Feb 8, 2026

Summary

  • Implements proper Windows memory tracking in used_memory() function
  • Previously returned 0 on Windows due to missing resource module
  • Now uses psutil.Process().memory_info().rss (already available as test dependency)
  • Includes fallback to maintain backward compatibility if psutil unavailable

Changes

  • Modified jina/logging/profile.py to use psutil on Windows
  • Removed TODO comment as issue is now resolved

Test plan

  • Manual testing on Windows confirms memory tracking now works
  • Existing tests continue to pass
  • No breaking changes to API

Generated with Claude Code

Previously, the used_memory() function returned 0 on Windows due to
the resource module not being available. This fix implements proper
memory tracking for Windows using psutil.Process().memory_info().rss,
which is already available as a test dependency.

The implementation includes a fallback to return 0 if psutil is not
available, maintaining backward compatibility.
@veeceey
Copy link
Author

veeceey commented Feb 19, 2026

Friendly ping - any chance someone could take a look at this when they get a chance? Happy to make any changes if needed.

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.

1 participant