try 0028 (and may be two other patches) and see if situation improves?

On Monday, February 21, 2022, Stefan de Konink via Cin <
[email protected]> wrote:

> I have imported a bunch of 4K video's and created a proxy out of it. In
> that Cinelerra session my memory usage became 9.9GB. When closing the
> project and reopening it the totally used memory reduced. What to make of
> this?
>
> skinkie    30046  319 62.0 17949716 9986224 pts/1 Sl+ 10:34 124:49 cin
>
> skinkie   144059 51.9 47.0 16050360 7573660 pts/1 Sl+ 11:14   1:56 cin
>
>
> Regardless of the above, I wonder if the memory pressure can be reduced in
> any way. Are the IDX's taking up memory?
>
> --
> Stefan
> --
> Cin mailing list
> [email protected]
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
From d6763dff2779a2fbdb547960bf8c80463516596f Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 11 Oct 2021 11:55:08 +0300
Subject: [PATCH 28/35] mem and resource leaks in indexfile/indextate
 (cppcheck)

---
 cinelerra-5.1/cinelerra/indexfile.C  | 3 ++-
 cinelerra-5.1/cinelerra/indexstate.C | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/indexfile.C b/cinelerra-5.1/cinelerra/indexfile.C
index 977ad1cb..2e1b0c73 100644
--- a/cinelerra-5.1/cinelerra/indexfile.C
+++ b/cinelerra-5.1/cinelerra/indexfile.C
@@ -859,7 +859,8 @@ int IndexFile::read_info(Indexable *test_indexable)
 
 		data = new char[index_state->index_start];
 		temp = fread(data, index_state->index_start - sizeof(int64_t), 1, fd);
-		if(!temp) return 1;
+		if(!temp) { delete [] data;
+		return 1;}
 
 		data[index_state->index_start - sizeof(int64_t)] = 0;
 		FileXML xml;
diff --git a/cinelerra-5.1/cinelerra/indexstate.C b/cinelerra-5.1/cinelerra/indexstate.C
index 803c4f0b..87d907a1 100644
--- a/cinelerra-5.1/cinelerra/indexstate.C
+++ b/cinelerra-5.1/cinelerra/indexstate.C
@@ -304,6 +304,7 @@ int IndexState::read_markers(char *index_dir, char *file_path)
 			if( memcmp(version, MARKER_MAGIC_VERSION, vsz) ) {
 				eprintf(_("IndexState::read_markers marker file version mismatched\n: %s\n"),
 					marker_path);
+				fclose(fp);
 				return 1;
 			}
 			ret = read_marks(fp);
-- 
2.34.0

From 372da719bd94a7fa5618d843c631fbf8c9b0931a Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 11 Oct 2021 11:56:05 +0300
Subject: [PATCH 29/35] cppcheck in cursor.C

---
 cinelerra-5.1/cinelerra/cursor.C | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cinelerra-5.1/cinelerra/cursor.C b/cinelerra-5.1/cinelerra/cursor.C
index b392dda1..87f932bb 100644
--- a/cinelerra-5.1/cinelerra/cursor.C
+++ b/cinelerra-5.1/cinelerra/cursor.C
@@ -51,6 +51,7 @@ return 0;
 int Cursor_::draw(int flash, long selectionstart, long selectionend, long zoom_sample, long viewstart, int vertical)
 {
 return 0;
+#if 0
 	if(canvas->get_h() * canvas->get_w() == 0) return 1;
 	if(zoom_sample == 0) return 1;       // no canvas
 
@@ -93,6 +94,7 @@ return 0;
 		canvas->set_opaque();
 	}
 	if(flash) canvas->flash();
+#endif
 }
 
 int Cursor_::resize(int w, int h)
-- 
2.34.0

From 20948d9b4549461fab4e88bda064e65fa13dd0cd Mon Sep 17 00:00:00 2001
From: Andrew Randrianasulu <[email protected]>
Date: Mon, 11 Oct 2021 11:56:57 +0300
Subject: [PATCH 30/35] cppcheck in resourcepixmap.C

---
 cinelerra-5.1/cinelerra/resourcepixmap.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C
index 1406dd2d..5b5a12f8 100644
--- a/cinelerra-5.1/cinelerra/resourcepixmap.C
+++ b/cinelerra-5.1/cinelerra/resourcepixmap.C
@@ -238,7 +238,7 @@ VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color)
 	c.r = color>>16;  c.g = color>>8;  c.b = color>>0;  c.a = 0xff;
 	if( BC_CModels::has_alpha(colormodel) && // fast path
 	    BC_CModels::calculate_pixelsize(colormodel) == sizeof(unsigned) ) {
-		const unsigned gap_rgba = (0xff<<24) |
+		const unsigned gap_rgba = ((uint32_t)(0xff)<<24) |
 			(gap_grey<<16) | (gap_grey<<8) | (gap_grey<<0);
 		if( th > 0 ) {
 			unsigned *bp = (unsigned *)bar_rows[0];
-- 
2.34.0

-- 
Cin mailing list
[email protected]
https://lists.cinelerra-gg.org/mailman/listinfo/cin

Reply via email to