Hi,
provided patch helps to estimate amount of memory allocated and used by
mlt_pool
--
________________________________________
Maksym Veremeyenko
>From 3cdef75e3e2f5056773cf14f8bff57c01d61035e Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1.tv>
Date: Tue, 4 Nov 2014 13:22:35 +0200
Subject: [PATCH 3/3] calculate total bytes allocated and used by mlt_pool
---
src/framework/mlt_pool.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/framework/mlt_pool.c b/src/framework/mlt_pool.c
index ddf4591..9d16d40 100644
--- a/src/framework/mlt_pool.c
+++ b/src/framework/mlt_pool.c
@@ -402,6 +402,7 @@ void mlt_pool_close( )
void mlt_pool_stat( )
{
// Stats dump
+ int64_t allocated = 0, used = 0;
int i = 0, c = mlt_properties_count( pools );
mlt_log( NULL, MLT_LOG_VERBOSE, "%s: count %d\n", __FUNCTION__, c);
@@ -413,5 +414,10 @@ void mlt_pool_stat( )
mlt_log( NULL, MLT_LOG_VERBOSE, "%s: size %d allocated %d returned %d %c\n", __FUNCTION__,
pool->size, pool->count, mlt_deque_count( pool->stack ),
pool->count != mlt_deque_count( pool->stack ) ? '*' : ' ' );
+ allocated += pool->count * pool->size;
+ used += ( pool->count - mlt_deque_count( pool->stack ) ) * pool->size;
}
+
+ mlt_log( NULL, MLT_LOG_VERBOSE, "%s: allocated %"PRId64" bytes, used %"PRId64" bytes \n",
+ __FUNCTION__, allocated, used );
}
--
1.7.7.6
------------------------------------------------------------------------------
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel