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

Python Maagic cache

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

Everyone's tags (3)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: Python Maagic cache

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.

1 REPLY 1
Highlighted
Cisco Employee

Re: Python Maagic cache

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.