Re: [racket-users] Garbage Collection of Places

2015-08-18 Thread Matthew Flatt
At Mon, 17 Aug 2015 12:21:41 -0700 (PDT), Jack Firth wrote: > On Monday, August 17, 2015 at 9:07:15 AM UTC-7, Matthew Flatt wrote: > > That's an especially basic mistake, and it slipped by because low-level > > locks are rarely allocated in the run-time system. Place channels are > > probably the s

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Neil Van Dyke
Jack Firth wrote on 08/17/2015 03:21 PM: From my limited experience with C, I've learned it's pretty much impossible to expect any sane human to keep track of memory perfectly. That's a helpful impression. C must be feared and respected, before it can be tamed. That said, I think it's feasi

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Jack Firth
On Monday, August 17, 2015 at 9:07:15 AM UTC-7, Matthew Flatt wrote: > That's an especially basic mistake, and it slipped by because low-level > locks are rarely allocated in the run-time system. Place channels are > probably the simplest way to trigger new locks, but the test that > checks for lea

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Tim Brown
Thank you Matthew. On 17/08/15 17:07, Matthew Flatt wrote: > That's an especially basic mistake, and it slipped by because low-level > locks are rarely allocated in the run-time system. Place channels are > probably the simplest way to trigger new locks, but the test that > checks for leaks with p

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
The problem is in the clean-up of OS-level locks. A lock is allocated using a combination of malloc() and pthread_mutex_init(), for example. The clean up was usually missing the free() to go along with pthread_mutex_destroy(). That's an especially basic mistake, and it slipped by because low-level

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Matthew Flatt
I'm looking into this. I can confirm that the GC thinks there's no leak, but the OS thinks there is. Thanks for the example and info! At Mon, 17 Aug 2015 16:09:00 +0100, Tim Brown wrote: > Sam, > > I don’t see the leak with (display (current-memory-use)) -- sorry for > leaving it in the example,

Re: [racket-users] Garbage Collection of Places

2015-08-17 Thread Tim Brown
Sam, I don’t see the leak with (display (current-memory-use)) -- sorry for leaving it in the example, it’s misleading since your numbers behave like mine did when I used that function. I *do*, however, see the leak on my gnome-system-monitor; which looks like something that’s invisible to the GC