Re: How to deallocate memory

From: Mary Haley (haley AT XXXXXX)
Date: Wed Dec 03 2003 - 09:37:34 MST

  • Next message: Dennis Shea: "dim_gbits"

    >
    > dave,
    >
    > delete is the function you want. you need to remember though that once a
    > memory threshold has been reached it can never be shortened.
    >
    > e.g.
    >
    > you create a variable x(10,30,40)
    > and then a variable y(10,30,40)
    >
    > your total memory allocated at this point is 2*10*30*48*4 for reals
    >
    > then you delete(x)
    >
    > your active memory is only y, but the computer keeps the total memory for
    > the entire job still at the upper limit created by the creation of x and
    > y.
    >
    > this is not an NCL issue, but how memory works.
    >
    > anyway, this may be the behavior you are seeing. when you say that delete
    > is not working, you can do this test:
    >
    > x = create array
    > delete(x)
    > print(x)
    > if x prints then delete is not working. if you get an error message then x
    > was removed.
    >
    > sm

    As a side note to this, you can also determine if "x" is a variable by
    typing:

        print(isvar("x"))

    This will either print True or False, depending on whether "x" is
    a variable.

    I will look into adding the above footnote to the "delete" documentation
    as you requested in a separate email.

    --Mary

    >
    >
    >
    > On Tue, 2 Dec 2003, Dave Allured wrote:
    >
    > > Hello.
    > >
    > > How do I actually deallocate unwanted memory when running an NCL script?
    > > The function delete (var) does not seem to do this according to my
    > > experiments. I work with large arrays, so sometimes this is important.
    > >
    > > Thank you.
    > >
    > > --Dave A.
    > >
    > > _______________________________________________
    > > ncl-talk mailing list
    > > ncl-talk@ucar.edu
    > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    > >
    >
    >
    >
    > ******************************************************
    > Sylvia Murphy EML: murphys@ucar.edu
    > NCAR CGD/CAS PHN: 303-497-1720
    > 3080 Center Green Drive FAX: 303-497-1333
    > Boulder CO 80301
    >
    >
    > WEB: http://www.cgd.ucar.edu/csm/support/
    > http://www.cgd.ucar.edu/csm/support/CSM_Graphics/
    > ******************************************************
    >
    >
    >
    > _______________________________________________
    > ncl-talk mailing list
    > ncl-talk@ucar.edu
    > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    >

    -- 
    -------------------------------------------------
    Mary Haley                   haley@ucar.edu
    NCAR/SCD/VETS                303-497-1254 (voice)
    1850 Table Mesa Dr           303-497-1804 (fax)
    Boulder, CO  80305
    -------------------------------------------------
    _______________________________________________
    ncl-talk mailing list
    ncl-talk@ucar.edu
    http://mailman.ucar.edu/mailman/listinfo/ncl-talk
    



    This archive was generated by hypermail 2b29 : Wed Dec 03 2003 - 09:39:15 MST