Skip to content

VCS and template object clean up to aid iteration speed and memory footprint #242

@durack1

Description

@durack1

There have been a number of issues that describe code slowdowns and considerable memory growth when generate pngs using loops. Some of the problems are highlighted in the issues:
#241
#237
#236
#235
PCMDI/amipbcs#10
CDAT/cdat#1424
CDAT/cdat#1397

It appears the primary problem, is that vcs and EzTemplate objects are being created and never deleted, and over an iteration of ~8000 this can lead to a huge memory footprint (~1 -> 100Gb) and a very marked slowdown (~3 to 2000s) in the time taken to generate a single 3 panel png output file.

There are a number of ways to resolve this, and I believe the vcs.removeobject function should be augmented to provide a user the ability to purge all vcs (and EzTemplate or all used graphic) objects in the current session, so a command like:

vcs.removeobject('all',force=True)

This example function would purge ALL objects, even if there are current handles to them (the force=True option).

It would be useful to think about other use cases, and then incorporate these into the single function, rather than having multiple functions that do variants of the same thing.. Oh yes, and documentation of this functionality will be key

@lee1043 @doutriaux1 @danlipsa pinging you all here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions