Bug #10445

Updated by Peter Amstutz over 1 year ago

Currently, each new CollectionReader creates its own API client, and Keep client, and block cache unless the caller supplies an API client object _(and Keep client object?)_. If a caller creates 10 CollectionReaders and reads 64 MiB from each one, the program will use 640 MiB. Possibly due to HTTP KeepAlive behavior, Python does not reclaim memory even if the caller unreferences the CollectionReaders. For example, this script leaks memory and network connections: 

 <pre><code class="python"> 
 import arvados 

 uuid = '......' 
 for i in range(20): 
     cr = arvados.collection.CollectionReader(uuid) 
     for fn in cr: 
         f =  

 Proposed improvement: 

 Share block caches between auto-instantiated API clients that use the same settings. 

 This also applied to KeepClient and BlockManager