Re: [Rd] How to debug: Cons memory exhausted

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Thu, 24 Jun 2010 12:53:54 -0400

On Jun 20, 2010, at 11:15 AM, Saptarshi Guha wrote:

> Hello,
> I get an error when binary structures from a pipe
>
> 'Error: cons memory exhausted (limit reached?)' (but R does not crash)
>
> This is probably due to some bug in my code, but occurs after reading
> about 85K pairs of RAWSXP objects (each < 20 bytes).
>
> I do not have any explicit calls to malloc/calloc
>

It has nothing to do with malloc/calloc - it means that the number of nodes (=R objects) has reached the limit. Normally the limit is soft so it will adjust up to SIZE_MAX (for all practical purposes unlimited on 64-bit machines). However, in low-memory conditions it may not be possible to allocate more heap space so that is more likely your limit.

> I'm going through my code and have inserted the (brute force) printf
> statements
> my question is: Does anybody have an advice on debugging this particular
> error?
>

You can set a breakpoint on mem_err_cons. In general it means that you are simply running out of memory.

Cheers,
Simon



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu 24 Jun 2010 - 16:56:32 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Jun 2010 - 13:21:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive