Julia 1.1 with JLD HDF5 package and memory release in WindowsCan memory be cleaned up?Why malloc always return NULLTrying to find a way to construct Julia `generator`Memory does not allocate in C++ release build with C#R memory not released in WindowsRelease memory in JuliaJulia : JLD package doesn't work when running Julia development versionJulia: How to modify a column of a matrix that has been saved as a binary file?cudaMemGetInfo value is not correctIs there a memory leak in HDF5 for Julia?

Has the Hulk always been able to talk?

Where are the "shires" in the UK?

How can I evaluate this integral

Krull dimension of the ring of global sections

Who filmed the Apollo 11 trans-lunar injection?

In "Avengers: Endgame", what does this name refer to?

Would a small hole in a Faraday cage drastically reduce its effectiveness at blocking interference?

Constitutional limitation of criminalizing behavior in US law?

Why did the Apollo 13 crew extend the LM landing gear?

Should homeowners insurance cover the cost of the home?

How to remap repeating commands i.e. <number><command>?

Determine if a grid contains another grid

How do I, as a DM, handle a party that decides to set up an ambush in a dungeon?

Hostile Divisor Numbers

Does running exec do anything?

Page count conversion from single to double-space for submissions

How can I get people to remember my character's gender?

Why does blending blueberries, milk, banana and vanilla extract cause the mixture to have a yogurty consistency?

Meaning of the (idiomatic?) expression "seghe mentali"

Find the limit or prove that it does not exist

about academic proof-reading, what to do in this situation?

Endgame puzzle: How to avoid stalemate and win?

Some Russian letters overlap the next line of text when used in drop caps

All superlinear runtime algorithms are asymptotically equivalent to convex function?



Julia 1.1 with JLD HDF5 package and memory release in Windows


Can memory be cleaned up?Why malloc always return NULLTrying to find a way to construct Julia `generator`Memory does not allocate in C++ release build with C#R memory not released in WindowsRelease memory in JuliaJulia : JLD package doesn't work when running Julia development versionJulia: How to modify a column of a matrix that has been saved as a binary file?cudaMemGetInfo value is not correctIs there a memory leak in HDF5 for Julia?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm using Julia 1.1 with JLD and HDF5 to save a file onto the disk, where I met a couple of question about the memory usage.



Issue 1:



First, I defined a 4 GB matrix A.



A = zeros(ComplexF64,(243,243,4000));


When I type the command and look at windows task manager:



A=nothing


It took several minutes for Julia to release those memory back to me. Most of the time, (In Task manager) Julia just doesn't release the memory usage at all, even though the command returned results saying that A occupied 0 bytes instantly.



varinfo()

name size summary
–––––––––––––––– ––––––––––– –––––––
A 0 bytes Nothing
Base Module
Core Module
InteractiveUtils 162.930 KiB Module
Main Module
ans 0 bytes Nothing


Issue 2:



Further, when I tried to use JLD and HDF5 to save file onto the disk. This time, the task manager told me that, when using the save("test.jld", "A", A) command, an extra 4GB memory was used.



using JLD,HDF5
A = zeros(ComplexF64,(243,243,4000));
save("test.jld", "A", A)


Further, after I typed



A=nothing


Julia won't release the 8 GB memory back to me.



Finding 3:



An interesting thing I found was that, if I retype the command



A = zeros(ComplexF64,(243,243,4000));


The task manager would told me the cashed memory was released, and the total memory usage was again only 4GB.



Question 1:



What's going on with memory management in Julia? Was it just a mistake by Windows, or some command in Julia? How to check the Julia memory usage instantly?



Question 2:



How to tell the Julia to instantly release the memory usage?



Question 3:



Is there a way to tell JLD package not use those extra 4GB meomory?



(Better, could someone tell me how to create A directly on the disk without even creating it in the memory? I knew there's memory mapped I/O in JLD package. I have tried it, but it seemed to require me to create matrix A in the memory and save A onto the disk first, before I could recall the memory mapped A again. )



This is a long question, so thanks ahead!










share|improve this question
























  • This has nothing to do with dates, so I removed your last tag.

    – phg
    Mar 23 at 11:15






  • 1





    Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

    – Przemyslaw Szufel
    Mar 23 at 19:15











  • @PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

    – user9976437
    Mar 23 at 19:39







  • 1





    I added an answer (the comment field was to short for good explanation)

    – Przemyslaw Szufel
    Mar 23 at 21:32

















0















I'm using Julia 1.1 with JLD and HDF5 to save a file onto the disk, where I met a couple of question about the memory usage.



Issue 1:



First, I defined a 4 GB matrix A.



A = zeros(ComplexF64,(243,243,4000));


When I type the command and look at windows task manager:



A=nothing


It took several minutes for Julia to release those memory back to me. Most of the time, (In Task manager) Julia just doesn't release the memory usage at all, even though the command returned results saying that A occupied 0 bytes instantly.



varinfo()

name size summary
–––––––––––––––– ––––––––––– –––––––
A 0 bytes Nothing
Base Module
Core Module
InteractiveUtils 162.930 KiB Module
Main Module
ans 0 bytes Nothing


Issue 2:



Further, when I tried to use JLD and HDF5 to save file onto the disk. This time, the task manager told me that, when using the save("test.jld", "A", A) command, an extra 4GB memory was used.



using JLD,HDF5
A = zeros(ComplexF64,(243,243,4000));
save("test.jld", "A", A)


Further, after I typed



A=nothing


Julia won't release the 8 GB memory back to me.



Finding 3:



An interesting thing I found was that, if I retype the command



A = zeros(ComplexF64,(243,243,4000));


The task manager would told me the cashed memory was released, and the total memory usage was again only 4GB.



Question 1:



What's going on with memory management in Julia? Was it just a mistake by Windows, or some command in Julia? How to check the Julia memory usage instantly?



Question 2:



How to tell the Julia to instantly release the memory usage?



Question 3:



Is there a way to tell JLD package not use those extra 4GB meomory?



(Better, could someone tell me how to create A directly on the disk without even creating it in the memory? I knew there's memory mapped I/O in JLD package. I have tried it, but it seemed to require me to create matrix A in the memory and save A onto the disk first, before I could recall the memory mapped A again. )



This is a long question, so thanks ahead!










share|improve this question
























  • This has nothing to do with dates, so I removed your last tag.

    – phg
    Mar 23 at 11:15






  • 1





    Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

    – Przemyslaw Szufel
    Mar 23 at 19:15











  • @PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

    – user9976437
    Mar 23 at 19:39







  • 1





    I added an answer (the comment field was to short for good explanation)

    – Przemyslaw Szufel
    Mar 23 at 21:32













0












0








0








I'm using Julia 1.1 with JLD and HDF5 to save a file onto the disk, where I met a couple of question about the memory usage.



Issue 1:



First, I defined a 4 GB matrix A.



A = zeros(ComplexF64,(243,243,4000));


When I type the command and look at windows task manager:



A=nothing


It took several minutes for Julia to release those memory back to me. Most of the time, (In Task manager) Julia just doesn't release the memory usage at all, even though the command returned results saying that A occupied 0 bytes instantly.



varinfo()

name size summary
–––––––––––––––– ––––––––––– –––––––
A 0 bytes Nothing
Base Module
Core Module
InteractiveUtils 162.930 KiB Module
Main Module
ans 0 bytes Nothing


Issue 2:



Further, when I tried to use JLD and HDF5 to save file onto the disk. This time, the task manager told me that, when using the save("test.jld", "A", A) command, an extra 4GB memory was used.



using JLD,HDF5
A = zeros(ComplexF64,(243,243,4000));
save("test.jld", "A", A)


Further, after I typed



A=nothing


Julia won't release the 8 GB memory back to me.



Finding 3:



An interesting thing I found was that, if I retype the command



A = zeros(ComplexF64,(243,243,4000));


The task manager would told me the cashed memory was released, and the total memory usage was again only 4GB.



Question 1:



What's going on with memory management in Julia? Was it just a mistake by Windows, or some command in Julia? How to check the Julia memory usage instantly?



Question 2:



How to tell the Julia to instantly release the memory usage?



Question 3:



Is there a way to tell JLD package not use those extra 4GB meomory?



(Better, could someone tell me how to create A directly on the disk without even creating it in the memory? I knew there's memory mapped I/O in JLD package. I have tried it, but it seemed to require me to create matrix A in the memory and save A onto the disk first, before I could recall the memory mapped A again. )



This is a long question, so thanks ahead!










share|improve this question
















I'm using Julia 1.1 with JLD and HDF5 to save a file onto the disk, where I met a couple of question about the memory usage.



Issue 1:



First, I defined a 4 GB matrix A.



A = zeros(ComplexF64,(243,243,4000));


When I type the command and look at windows task manager:



A=nothing


It took several minutes for Julia to release those memory back to me. Most of the time, (In Task manager) Julia just doesn't release the memory usage at all, even though the command returned results saying that A occupied 0 bytes instantly.



varinfo()

name size summary
–––––––––––––––– ––––––––––– –––––––
A 0 bytes Nothing
Base Module
Core Module
InteractiveUtils 162.930 KiB Module
Main Module
ans 0 bytes Nothing


Issue 2:



Further, when I tried to use JLD and HDF5 to save file onto the disk. This time, the task manager told me that, when using the save("test.jld", "A", A) command, an extra 4GB memory was used.



using JLD,HDF5
A = zeros(ComplexF64,(243,243,4000));
save("test.jld", "A", A)


Further, after I typed



A=nothing


Julia won't release the 8 GB memory back to me.



Finding 3:



An interesting thing I found was that, if I retype the command



A = zeros(ComplexF64,(243,243,4000));


The task manager would told me the cashed memory was released, and the total memory usage was again only 4GB.



Question 1:



What's going on with memory management in Julia? Was it just a mistake by Windows, or some command in Julia? How to check the Julia memory usage instantly?



Question 2:



How to tell the Julia to instantly release the memory usage?



Question 3:



Is there a way to tell JLD package not use those extra 4GB meomory?



(Better, could someone tell me how to create A directly on the disk without even creating it in the memory? I knew there's memory mapped I/O in JLD package. I have tried it, but it seemed to require me to create matrix A in the memory and save A onto the disk first, before I could recall the memory mapped A again. )



This is a long question, so thanks ahead!







memory-management julia memory-mapped-files






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 23 at 11:14









phg

10.6k32845




10.6k32845










asked Mar 23 at 2:26









user9976437user9976437

1304




1304












  • This has nothing to do with dates, so I removed your last tag.

    – phg
    Mar 23 at 11:15






  • 1





    Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

    – Przemyslaw Szufel
    Mar 23 at 19:15











  • @PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

    – user9976437
    Mar 23 at 19:39







  • 1





    I added an answer (the comment field was to short for good explanation)

    – Przemyslaw Szufel
    Mar 23 at 21:32

















  • This has nothing to do with dates, so I removed your last tag.

    – phg
    Mar 23 at 11:15






  • 1





    Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

    – Przemyslaw Szufel
    Mar 23 at 19:15











  • @PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

    – user9976437
    Mar 23 at 19:39







  • 1





    I added an answer (the comment field was to short for good explanation)

    – Przemyslaw Szufel
    Mar 23 at 21:32
















This has nothing to do with dates, so I removed your last tag.

– phg
Mar 23 at 11:15





This has nothing to do with dates, so I removed your last tag.

– phg
Mar 23 at 11:15




1




1





Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

– Przemyslaw Szufel
Mar 23 at 19:15





Sometimes the garbage collector does not need to run immedietaly. What happens when you call GC.gc()?

– Przemyslaw Szufel
Mar 23 at 19:15













@PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

– user9976437
Mar 23 at 19:39






@PrzemyslawSzufel Thanks you! It seemed to be working(Memory reduced instantly) after I called GC.gc() . Do you know what's going on? and what did GC.gc() do?

– user9976437
Mar 23 at 19:39





1




1





I added an answer (the comment field was to short for good explanation)

– Przemyslaw Szufel
Mar 23 at 21:32





I added an answer (the comment field was to short for good explanation)

– Przemyslaw Szufel
Mar 23 at 21:32












1 Answer
1






active

oldest

votes


















2














Julia uses garbage collector to de-alocate the memory. Usually a garbage collector does not run after every line of code but only when needed.



Try to force garbage collection by running the command:



GC.gc()


This releases memory space for unreferenced Julia objects. In this way you can check whether the memory actually has been released.



Side note: JLD used to be somewhat not-always-working (I do not know the current status). Hence you first consideration for non-cross-platform object persistence always should be the serialize function from the in-built Serialization package - check the documentation at https://docs.julialang.org/en/v1/stdlib/Serialization/index.html#Serialization.serialize






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310031%2fjulia-1-1-with-jld-hdf5-package-and-memory-release-in-windows%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Julia uses garbage collector to de-alocate the memory. Usually a garbage collector does not run after every line of code but only when needed.



    Try to force garbage collection by running the command:



    GC.gc()


    This releases memory space for unreferenced Julia objects. In this way you can check whether the memory actually has been released.



    Side note: JLD used to be somewhat not-always-working (I do not know the current status). Hence you first consideration for non-cross-platform object persistence always should be the serialize function from the in-built Serialization package - check the documentation at https://docs.julialang.org/en/v1/stdlib/Serialization/index.html#Serialization.serialize






    share|improve this answer



























      2














      Julia uses garbage collector to de-alocate the memory. Usually a garbage collector does not run after every line of code but only when needed.



      Try to force garbage collection by running the command:



      GC.gc()


      This releases memory space for unreferenced Julia objects. In this way you can check whether the memory actually has been released.



      Side note: JLD used to be somewhat not-always-working (I do not know the current status). Hence you first consideration for non-cross-platform object persistence always should be the serialize function from the in-built Serialization package - check the documentation at https://docs.julialang.org/en/v1/stdlib/Serialization/index.html#Serialization.serialize






      share|improve this answer

























        2












        2








        2







        Julia uses garbage collector to de-alocate the memory. Usually a garbage collector does not run after every line of code but only when needed.



        Try to force garbage collection by running the command:



        GC.gc()


        This releases memory space for unreferenced Julia objects. In this way you can check whether the memory actually has been released.



        Side note: JLD used to be somewhat not-always-working (I do not know the current status). Hence you first consideration for non-cross-platform object persistence always should be the serialize function from the in-built Serialization package - check the documentation at https://docs.julialang.org/en/v1/stdlib/Serialization/index.html#Serialization.serialize






        share|improve this answer













        Julia uses garbage collector to de-alocate the memory. Usually a garbage collector does not run after every line of code but only when needed.



        Try to force garbage collection by running the command:



        GC.gc()


        This releases memory space for unreferenced Julia objects. In this way you can check whether the memory actually has been released.



        Side note: JLD used to be somewhat not-always-working (I do not know the current status). Hence you first consideration for non-cross-platform object persistence always should be the serialize function from the in-built Serialization package - check the documentation at https://docs.julialang.org/en/v1/stdlib/Serialization/index.html#Serialization.serialize







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 23 at 21:32









        Przemyslaw SzufelPrzemyslaw Szufel

        3,090214




        3,090214





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55310031%2fjulia-1-1-with-jld-hdf5-package-and-memory-release-in-windows%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript