Skip to content

feat: memory optimization and logging improvements#18

Merged
msxdan merged 1 commit into
mainfrom
feat/memory-optimization
Nov 10, 2025
Merged

feat: memory optimization and logging improvements#18
msxdan merged 1 commit into
mainfrom
feat/memory-optimization

Conversation

@msxdan

@msxdan msxdan commented Nov 10, 2025

Copy link
Copy Markdown
Owner

This pull request introduces significant improvements to RepoVault's memory management and concurrency controls, as well as updates to documentation and configuration to better support these features. The most important changes are the introduction of a configurable limit on concurrent repository syncs to prevent memory spikes, removal of in-memory git repository caching to drastically reduce memory usage, and several related documentation and configuration updates.

Concurrency and Memory Management Improvements:

  • Added a new max_concurrent_repos setting (default: 3) to limit the number of repositories syncing at once, implemented via a semaphore. This prevents memory spikes during initial syncs, especially with large repositories. (src/main.go, config.example.yaml, README.md) [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]
  • Removed repository object caching: now, repositories are opened fresh for each sync, allowing Go's garbage collector to reclaim memory and reducing the memory footprint by up to 74%. (src/main.go) [1] [2] [3]

State Management and Logging:

  • State saves (sync state JSON file) are now synchronous instead of spawning a new goroutine each time, preventing unbounded goroutine accumulation and associated memory leaks. (src/main.go, CHANGELOG.md) [1] [2]
  • Log timestamps now include the date for improved traceability, and example outputs in the documentation have been updated accordingly. (src/main.go, README.md) [1] [2] [3] [4] [5]

Documentation and Configuration Updates:

  • Updated README.md and config.example.yaml to document the new concurrency controls, provide memory usage guidelines, and clarify resource recommendations. (README.md, config.example.yaml) [1] [2] [3] [4] [5] [6]
  • Increased default resource limits and healthcheck leniency in docker-compose.yml to reflect higher memory needs during concurrent syncs and to reduce false positives during heavy operations. (docker-compose.yml) [1] [2]

Changelog:

  • Added a CHANGELOG.md file following Keep a Changelog and Semantic Versioning, documenting all notable changes in this release.

These changes collectively make RepoVault much more robust and reliable for users syncing multiple or large repositories, especially in resource-constrained environments.

@msxdan msxdan marked this pull request as ready for review November 10, 2025 00:16
@msxdan msxdan merged commit a48fbe9 into main Nov 10, 2025
@msxdan msxdan deleted the feat/memory-optimization branch November 10, 2025 00:17
msxdan added a commit that referenced this pull request Nov 10, 2025
The workflow was falling back to v0.0.0 because tags weren't fully synced
before running git describe. This caused PR #18 to create v0.1.0 instead
of v0.3.0.

Now explicitly fetching tags with --force before version calculation.
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.

1 participant