Re: Gradual Growth of Memory Use?

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]>
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
Yes, I call a C routine to interface to Win/11 MMIO system. I preallocate a ring of buffers and lock them down at the very start. No further allocations happen (from me, anyway). I pass the address of those buffers up to Lisp for processing, and then return them to the ring in the external C routine when finished.

I’m doing a ton of dynamic allocations in Lisp, and presumably those get freed up from time to time. 

The difficulty here is that it takes 24 hours for failures to suddenly begin. And the 1.5 GB allocation at that point should not be causing any trouble when I have 32 GB of RAM. Furthermore, those ADC buffers were allocated and locked down by the Win/11 system in the C routine at startup, not by Lisp.

But somehow, when I hit that level of allocation, the ADC Reader slows down and misses entire 4 KSamp blocks of data. So I continue to get data with massive holes in them, which totally hoses any spectral analysis that assumes a contiguous collection of data samples. 4096 samples at 8 kHz sample rate -> 0.5 sec of missing data in sporadic clusters of misses. I analyze the data in 512 sample groups to produce 1024 sample batches with 50% overlap.



> On Mar 12, 2025, at 05:50, Yuri Davidovsky <[email protected]> wrote:
> 
> 
> 
>> On 12 Mar 2025, at 13:34, David McClain (as dbm at refined-audiometrics dot com) <[email protected]> wrote:
>> 
>> The system produces live data plots, and there are some graphics elements that need to be allocated and freed for each graph redraw. I have tried eliding those allocations during plotting to see of that was the cause of memory leaks, and it appears not to be the case.
> 
> As I understand your setup, you have a lisp image communicating with an outside system using foreign function calls. Have you been able to establish if the leaks are happening within the lisp image, or within the external library that you are making calls to?
> 
> If that is the latter, it should be relatively easy to find and fix, provided that is your own lib. If the lib is a third party one, or the leaks are happening within the lisp image and gc is doing nothing… I can’t lie to you about your chances, but you have my sympathies.


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
[email protected]
http://www.lispworks.com/support/lisp-hug.html
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.