Re: [Rd] External pointers and an apparent memory leak

2011-09-15 Thread Simon Urbanek
R_MakeWeakRefC (memory.c:1198) > ==22098==by 0xE01BACF: h5R_allocate_k (h5_debug.c:33) > ==22098==by 0x4EE17E4: do_dotcall (dotcode.c:837) > ==22098==by 0x4F18D02: Rf_eval (eval.c:508) > ==22098==by 0x4F1A7FD: do_begin (eval.c:1420) > ==22098==by 0x4F18B1A: Rf_ev

Re: [Rd] External pointers and an apparent memory leak

2011-09-15 Thread James Bullard
=by 0x4E6F3D8: do_lapply (apply.c:72) Thanks for any help! jim ________________ From: Simon Urbanek [simon.urba...@r-project.org] Sent: Thursday, September 15, 2011 8:35 AM To: James Bullard Cc: r-devel@r-project.org Subject: Re: [Rd] External pointers and an apparent m

Re: [Rd] External pointers and an apparent memory leak

2011-09-15 Thread Simon Urbanek
Jim, On Sep 14, 2011, at 5:21 PM, James Bullard wrote: > I'm using external pointers and seemingly leaking memory. My determination of > a memory leak is that the R process continually creeps up in memory as seen > by top while the usage as reported by gc() stays flat. I have isolated the C >

Re: [Rd] External pointers and an apparent memory leak

2011-09-15 Thread Matt Shotwell
James, Works for me! In a file, 'test.c', I have: void h5R_allocate_finalizer(SEXP eptr) { char* vector = (char*) R_ExternalPtrAddr(eptr); free(vector); printf("memory freed at address %lu\n", (long unsigned) vector); R_ClearExternalPtr(eptr); } SEXP h5R_allocate(SEXP size) {

[Rd] External pointers and an apparent memory leak

2011-09-15 Thread James Bullard
I'm using external pointers and seemingly leaking memory. My determination of a memory leak is that the R process continually creeps up in memory as seen by top while the usage as reported by gc() stays flat. I have isolated the C code: void h5R_allocate_finalizer(SEXP eptr) { Rprintf("Calli