Page 2 of 2
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Wed Oct 09, 2013 3:43 pm
by Paul L
Perhaps a different pronlem. You add many one samples sounds but they have the same time extent, not disjoint.
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Wed Oct 30, 2013 6:23 am
by steve
Hi Paul. Did you get any further isolating this memory leak or working round it?
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Thu Oct 31, 2013 2:00 am
by Paul L
I found ways to work around it. Roger agreed there was a bug to fix there, in case of adding of sounds with domains that touch without overlapping, but I haven't heard more from him.
Now I concatenate a sequence of sounds by using snd-fromobject and an object that calls snd-fetch repeatedly on each. Sounds like doing more work in Lisp than I should, but it works.
But I am not using this technique on my current project of interest, that de-clicker which shows a lot of promise without relying on my other speech segmentation experiments.
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Thu Oct 31, 2013 3:27 am
by steve
Does this demonstrate the same problem that you had:
Code: Select all
;; Generate 10 minutes of silence
;; Memory usage goes up and stays up after completion.
(let ((mysound (abs-env (s-rest 0.1)))
(output (s-rest 0)))
(dotimes (i 6000 output)
(setf output
(sim output
(at-abs (* 0.1 i) (cue mysound))))))
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Thu Oct 31, 2013 5:45 am
by Paul L
I take your word that you observed great memory usage. Yes, it seems a similar problem.
I was also using tiny "sounds" of one sample only as summands, which may or may not be essential to the problem. Perhaps not, if this demonstrates the same problem.
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Thu Oct 31, 2013 2:38 pm
by steve
Paul L wrote:I take your word that you observed great memory usage.
Memory usage with that code is not massive, but much bigger than it should be, and importantly it is not released when the code completes.
A simple workaround for this example is to add an initial silence starting at t0, with a duration equal or greater than the expected output. All subsequent additions will then overlap this "dummy" silence in the time domain and the memory leak does not occur.
I'd like to get this bug on the Audacity bug tracking system so that it is tracked and not forgotten about. Is there anything that you'd like to add or clarify before I do?
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Thu Oct 31, 2013 4:38 pm
by Paul L
I think we have described the essentials of the problem. I have nothing to add.
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Wed Dec 04, 2013 6:01 am
by Paul L
I had a hypothesis about the cause of this memory leak, but it's not correct. I never hit the relevant code in the debugger with your example.
Re: Memory leaks in Nyquist or the Lisp environment?
Posted: Wed Dec 04, 2013 6:05 am
by Paul L
steve wrote:Thanks for the update Paul.
Probably related, I found that the following code causes a crash:
Code: Select all
(do ((i 0 (1+ i)))
((= i 100000) s)
(setf s (sum s (snd-const 0 0 *sound-srate* 1))))
That's a stack overflow. Different problem.