cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
443
Views
2
Helpful
1
Replies

Python Maagic cache

sspehar
Level 1
Level 1

Hi all,

When traversing the model tree, Maagic API (or Maapi underneath) stores all data in a cache, if there's alot of devices with bunch of configurations on them in NSO, and we're doing some complex operation where we have to go through most of the device model tree, this consumes too much memory. Is there a method to clear that cache?

Simon

1 Accepted Solution

Accepted Solutions

Jan Lindblad
Cisco Employee
Cisco Employee

MAAPI isn't doing any caching, so one option would be to go there instead.

Each MAAGIC object starts without any cached value. Only when the value is actually accessed, MAAGIC will go and read the value, then keep the value within itself "in a cache". There is no (official) way to clear that value once it has been read, but obviously deleting the object will also remove the cached value.

So with MAAGIC, you need to ensure you delete the objects that you no longer wish to know the value of.

View solution in original post

1 Reply 1

Jan Lindblad
Cisco Employee
Cisco Employee

MAAPI isn't doing any caching, so one option would be to go there instead.

Each MAAGIC object starts without any cached value. Only when the value is actually accessed, MAAGIC will go and read the value, then keep the value within itself "in a cache". There is no (official) way to clear that value once it has been read, but obviously deleting the object will also remove the cached value.

So with MAAGIC, you need to ensure you delete the objects that you no longer wish to know the value of.