[R] Possible memory leak in loop.

jim holtman jholtman at gmail.com
Mon Nov 1 14:48:28 CET 2010


If you are running on Windows, you might want to use 'perfmon' to look
at the memory usage of the process over time.  You might also want to
put calls to memory.size in your looping code to see if there are
things you are doing in the code that might temporarily use a lot of
space and maybe fragment memory.

On Mon, Nov 1, 2010 at 8:35 AM, Jonathan P Daily <jdaily at usgs.gov> wrote:
> I was trying to use memory.size() to determine whether a code loop I am
> executing created a memory leak, since one replicate of the simulation
> takes 670.98 seconds according to proc.time(), while 5 replicates takes
> 170762 seconds. So I set it up as:
>
> memA <- memory.size()
>
> looping code...
>
> memB <- memory.size()
>
> memA returns as 9.3, and memB returns 11.3. I'm not familiar with
> fluctuation patterns in RAM usage (if there are any). Does anyone with
> more experience know if this is indicative of a memory leak?
>
> Thanks,
>        Jon
> --------------------------------------
> Jonathan P. Daily
> Technician - USGS Leetown Science Center
> 11649 Leetown Road
> Kearneysville WV, 25430
> (304) 724-4480
> "Is the room still a room when its empty? Does the room,
>  the thing itself have purpose? Or do we, what's the word... imbue it."
>     - Jubal Early, Firefly
>        [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem that you are trying to solve?



More information about the R-help mailing list