[Bf-blender-cvs] [b5a14c3] master: Report total unfreed memory size on exit

Sergey Sharybin noreply at git.blender.org
Wed Feb 18 22:08:59 CET 2015


Commit: b5a14c381cd16aad77ba6aea95e623e83e159d4b
Author: Sergey Sharybin
Date:   Thu Feb 19 02:08:09 2015 +0500
Branches: master
https://developer.blender.org/rBb5a14c381cd16aad77ba6aea95e623e83e159d4b

Report total unfreed memory size on exit

Previously only number of unfreed blocks would have been printed,
which might not be totally enough during investigation process.

===================================================================

M	source/blender/windowmanager/intern/wm_init_exit.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index cb03d02..9778f16 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -537,7 +537,10 @@ void WM_exit_ext(bContext *C, const bool do_python)
 	BLI_threadapi_exit();
 
 	if (MEM_get_memory_blocks_in_use() != 0) {
-		printf("Error: Not freed memory blocks: %d\n", MEM_get_memory_blocks_in_use());
+		size_t mem_in_use = MEM_get_memory_in_use() + MEM_get_memory_in_use();
+		printf("Error: Not freed memory blocks: %d, total unfreed memory %f MB\n",
+		       MEM_get_memory_blocks_in_use(),
+		       (double)mem_in_use / 1024 / 1024);
 		MEM_printmemlist();
 	}
 	wm_autosave_delete();




More information about the Bf-blender-cvs mailing list