Skip to content

Advance sveltos-agent#442

Merged
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:advance-sveltos-agent
Feb 4, 2026
Merged

Advance sveltos-agent#442
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76:advance-sveltos-agent

Conversation

@gianlucam76
Copy link
Member

sveltos-agent memory usage has been optmized by re-using dynamic informer cache instead of direct API calls.

Previously, sveltos-agent made direct API calls using a new discovery client and dynamic client for each fetch. This approach:

  • Fetched all resources with full managedFields and bypassed the informer cache entirely
  • Created new discovery clients repeatedly (expensive operation)
  • Resulted in high memory usage when fetching large numbers of resources

Sveltos-agent code has been refactored to use the existing dynamic informer factory with transform functions:

  • Use informer cache when available - zero API calls, transforms already applied
  • Strip managedFields - in both code paths for consistency
  • Reuse cached REST mapper - avoid repeated discovery client creation

sveltos-agent memory usage has been optmized by re-using dynamic
informer cache instead of direct API calls.

Previously, sveltos-agent made direct API calls using a new discovery
client and dynamic client for each fetch. This approach:

- Fetched all resources with full managedFields and bypassed the
informer cache entirely
- Created new discovery clients repeatedly (expensive operation)
- Resulted in high memory usage when fetching large numbers of resources

Sveltos-agent code has been refactored to use the existing dynamic informer
factory with transform functions:

- Use informer cache when available - zero API calls, transforms already applied
- Strip managedFields - in both code paths for consistency
- Reuse cached REST mapper - avoid repeated discovery client creation
@gianlucam76 gianlucam76 force-pushed the advance-sveltos-agent branch from feb96b4 to 4e13328 Compare February 4, 2026 16:40
@gianlucam76 gianlucam76 merged commit 5c4764f into projectsveltos:main Feb 4, 2026
11 of 12 checks passed
@gianlucam76 gianlucam76 deleted the advance-sveltos-agent branch February 4, 2026 17:06
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