Skip to content

Advance sveltos-agent#377

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

Advance sveltos-agent#377
gianlucam76 merged 1 commit intoprojectsveltos:mainfrom
gianlucam76: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 merged commit 7b1df68 into projectsveltos:main Feb 4, 2026
6 checks passed
@gianlucam76 gianlucam76 deleted the sveltos-agent branch February 4, 2026 16:56
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