<div dir="ltr"><div class="gmail_default" style="font-size:small">Andrew,</div><div class="gmail_default" style="font-size:small">I think it is the same leak. <br></div><div class="gmail_default" style="font-size:small">Leak is gone when I changed the code back. I will test the one Nikon d3200.mp4 video I have. <br></div><div class="gmail_default" style="font-size:small">But after that I will have to stop for today due to being too tired.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 9:16 PM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 24 янв. 2023 г., 07:11 Phyllis Smith <<a href="mailto:phylsmith2017@gmail.com" target="_blank">phylsmith2017@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Andrew, no - removing that line does not help leak so it must be the "if parent". It takes awhile to test but will revert from current code of:</div><div class="gmail_default" style="font-size:small"> <span style="font-family:monospace"> if( users == 1 ) {</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> remove_user();</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> total_lock->unlock();</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> return 0</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> }</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> //printf("users: %i \n", users );</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> EDL *parent - edl->parent_edl;</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> if(parent)</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> remove_user();</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><br></span></div><div class="gmail_default" style="font-size:small">To:</div><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> if( users == 1 ) {</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> remove_user();</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> return 0<br></span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> }</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"> remove_user();</span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><span style="font-family:arial,sans-serif">Better to have EDL undo problem then run out of memory.</span></span></div></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">hm, may be I'll come with some additional line (like removing this *parent link) but can you just comment it out with</div><div dir="auto"><br></div><div dir="auto">// rem: it leask</div><div dir="auto"><br></div><div dir="auto">added?</div><div dir="auto"><br></div><div dir="auto">also, I thought Stefan was chasing earlier leak, may be independent from this one </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small"><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><br></span></div><div class="gmail_default" style="font-size:small"><span style="font-family:monospace"><br><br></span></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 8:31 PM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" rel="noreferrer" target="_blank">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 24 янв. 2023 г., 06:28 Phyllis Smith <<a href="mailto:phylsmith2017@gmail.com" rel="noreferrer noreferrer" target="_blank">phylsmith2017@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Andrew, I did get a little confused by part 1 and part 2 of that checkin. Did I get it wrong?<br></div></div></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">no ... I hope.</div><div dir="auto"><br></div><div dir="auto">does removing line I introduced</div><div dir="auto"><br></div><div dir="auto"> total_lock->unlock();<br></div><div dir="auto"><br></div><div dir="auto">help with leak?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small"></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 8:26 PM Phyllis Smith <<a href="mailto:phylsmith2017@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">phylsmith2017@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">Andrew,</div><div class="gmail_default" style="font-size:small">I found where the problem was introduced.</div><div class="gmail_default" style="font-size:small">Dec. 6, 2022 GIT is good. 3c7c8a08800c3e100388996f0e2c2eea9761ebe1</div><div class="gmail_default" style="font-size:small">Dec.27, 2022 GIT is bad. 175a7314e8e927128787feeb7ba5f42530f0a319</div><div class="gmail_default" style="font-size:small"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jan 23, 2023 at 7:51 PM Andrew Randrianasulu <<a href="mailto:randrianasulu@gmail.com" rel="noreferrer noreferrer noreferrer" target="_blank">randrianasulu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вт, 24 янв. 2023 г., 02:44 Stefan de Konink <<a href="mailto:stefan@konink.de" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">stefan@konink.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Andrew,<br>
<br>
When changing this, to be more in line with the "HV" code...<br>
<br>
diff --git a/cinelerra-5.1/cinelerra/playbackengine.C <br>
b/cinelerra-5.1/cinelerra/playbackengine.C<br>
index 815e506f..3c2a9368 100644<br>
--- a/cinelerra-5.1/cinelerra/playbackengine.C<br>
+++ b/cinelerra-5.1/cinelerra/playbackengine.C<br>
@@ -172,9 +172,9 @@ void PlaybackEngine::create_cache()<br>
{<br>
cache_lock->lock("PlaybackEngine::create_cache");<br>
if( audio_cache )<br>
- audio_cache->remove_user();<br>
+ delete audio_cache;<br>
if( video_cache )<br>
- video_cache->remove_user();<br>
+ delete video_cache;<br>
audio_cache = new CICache(preferences);<br>
video_cache = new CICache(preferences);<br>
cache_lock->unlock();<br>
<br>
<br>
...will result in a fix for the memory leak, but does cause a warning <br>
message.<br>
<br>
Garbage::~Garbage: title=CICache users=1 was not deleted by <br>
Garbage::remove_user<br>
<br>
<br>
This was changed with f5725c7e (7/4/20). </blockquote></div></div><div dir="auto"><br></div><div dir="auto"><a href="https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/cinelerra/playbackengine.C;h=82bd7bb6587b930b77caa7f4da7673255539b3a3;hp=8ce98234c3ffc7ed2b0ed6e4c00b4f6e3fa749ee;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hpb=c387b8938dc838e5b92d1cd735975d0928ecf61a" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/cinelerra/playbackengine.C;h=82bd7bb6587b930b77caa7f4da7673255539b3a3;hp=8ce98234c3ffc7ed2b0ed6e4c00b4f6e3fa749ee;hb=f5725c7e12def18fec49a295dad688652edaa4b3;hpb=c387b8938dc838e5b92d1cd735975d0928ecf61a</a><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">hm ....</div><div dir="auto"><br></div><div dir="auto">may be you also can try to restore this idea about calling new only if cache does not exist ...</div><div dir="auto"><br></div><div dir="auto"><div dir="auto">@@ -162,10 +164,12 @@ void PlaybackEngine::wait_render_engine()</div><div dir="auto"> </div><div dir="auto"> void PlaybackEngine::create_cache()</div><div dir="auto"> {</div><div dir="auto">- if(audio_cache) { delete audio_cache; audio_cache = 0; }</div><div dir="auto">- if(video_cache) { delete video_cache; video_cache = 0; }</div><div dir="auto">- if(!audio_cache) audio_cache = new CICache(preferences);</div><div dir="auto">- if(!video_cache) video_cache = new CICache(preferences);</div><div dir="auto">+ if( audio_cache )</div><div dir="auto">+ audio_cache->remove_user();</div><div dir="auto">+ if( video_cache )</div><div dir="auto">+ video_cache->remove_user();</div><div dir="auto">+ audio_cache = new CICache(preferences);</div><div dir="auto">+ video_cache = new CICache(preferences);</div><div dir="auto"> }</div><div dir="auto"> </div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">But also shows that many unrelated <br>
changes cause real issues to hide. I found this by hand, not even using git <br>
bisect. I understand the urge for the garbage collector, but for some <br>
reason not behaving. What I notice is that the 'last' object is empty when <br>
it is actually destroyed by the garbage collector (~CICache). What is the <br>
best way going forward? <br>
<br>
--<br>
Stefan<br>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div></div>
</blockquote></div>
</blockquote></div></div></div>
</blockquote></div>