On Thursday, 6 August 2015 22:34:26 UTC+10, Andrew B. Martin wrote: > > Thanks for the comment, Colin. > > Instead, the RAM usage counter ramped up to the upper limit I had set >> using a conditional if statement, and then when it hit that ... > > > I'm curious; can you give a code sample of the conditional if statement? >
Yes no worries, although I'm not sure it'll be much use as it is fairly specialised to the types I work with: function checkRAMUsage!(d::FinList) if sizeof(d) > 7000000000 println("FinList too large. Removing HF data and triggering garbage collection.") deleteatFinHF!(d) end #gc() #Currently this line doesn't seem to do anything so it is commented out return(true) end FinList is a type I made to store all the financial data I've read in to RAM, so simply testing the size of d in the code above gives a pretty accurate measure of how much RAM I'm currently using. I'm not aware of a general function to check how much RAM julia is currently using, but you could get a pretty god idea by looping over all the variables in workspace and adding up the output of sizeof on each of them. My function deleteatFinHF! just goes through the FinList and empties all the arrays of high-frequency data (which is invariably what is taking up most of the RAM in the work I do).