Why does my Julia program use so much memory?

According to topmy program, Julia addresses 14.5 GB of memory (the "VIRT" column in the output top), and the size in physical memory is 7.5 GB (the "RES" column). But when I insert calls whos()into my program, only about 100 MB of memory is taken into account:

                ArrayViews    190 KB     Module
                      Base  32427 KB     Module
                     Blosc     38 KB     Module
                  Calculus    178 KB     Module
                   Celeste   4034 KB     Module
                    Compat    126 KB     Module
                      Core   3268 KB     Module
                       DOC   1241 bytes  ASCIIString
                DataArrays    936 KB     Module
                DataFrames   1817 KB     Module
             Distributions   1245 KB     Module
                    DocOpt    221 KB     Module
                    Docile    420 KB     Module
               DualNumbers     59 KB     Module
                    FITSIO    971 KB     Module
                    FileIO    592 KB     Module
               ForwardDiff    304 KB     Module
                      GZip    588 KB     Module
                      HDF5   2698 KB     Module
                       JLD    335 KB     Module
                   Logging    103 KB     Module
                      Main  46514 KB     Module
                   NaNMath    121 KB     Module
                     Optim    475 KB     Module
                    PDMats    113 KB     Module
                  Reexport   3748 bytes  Module
         SortingAlgorithms     41 KB     Module
                 StatsBase    706 KB     Module
                 StatsFuns    289 KB     Module
                       WCS     78 KB     Module
                      main   8665 bytes  Function

How can I determine which data structures use all the memory? Or why is not freed memory freed? (I even sometimes call gc()sometimes.)

+4
source share
2 answers

whos, . 张 实 唯, whos. 80 ( 64- ), whos .

,

julia> module Test
           v = [[] for _ in 1:10000]
       end
Test

julia> whos(Test)
                          Test     80 KB     Module

80 , Test - . , .

+1

, , Julia http://docs.julialang.org/en/release-0.5/manual/profile/ . , , . @time, , , , , , , .

+1

All Articles