emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r117257: Improve dumped memory report on MS-Windows.


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r117257: Improve dumped memory report on MS-Windows.
Date: Wed, 04 Jun 2014 11:47:28 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 117257
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Wed 2014-06-04 14:46:51 +0300
message:
  Improve dumped memory report on MS-Windows.
  
   src/w32heap.c (report_temacs_memory_usage): Improve the report by
   reporting the large blocks that are actually occupied at dump time.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/w32heap.c                  w32heap.c-20091113204419-o5vbwnq5f7feedwu-810
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-06-04 07:54:16 +0000
+++ b/src/ChangeLog     2014-06-04 11:46:51 +0000
@@ -1,5 +1,9 @@
 2014-06-04  Eli Zaretskii  <address@hidden>
 
+       * w32heap.c (report_temacs_memory_usage): Improve the report by
+       reporting the large blocks that are actually occupied at dump
+       time.
+
        * w32console.c (initialize_w32_display): Set the console
        menu_show_hook, otherwise TTY menus are broken on w32.
 

=== modified file 'src/w32heap.c'
--- a/src/w32heap.c     2014-06-03 22:13:17 +0000
+++ b/src/w32heap.c     2014-06-04 11:46:51 +0000
@@ -479,7 +479,7 @@
       /* Look for the big chunk.  */
       int i;
 
-      for(i = 0; i < blocks_number; i++)
+      for (i = 0; i < blocks_number; i++)
        {
          if (blocks[i].address == ptr)
            {
@@ -498,11 +498,22 @@
 void
 report_temacs_memory_usage (void)
 {
+  DWORD blocks_used = 0, large_mem_used = 0;
+  int i;
+
+  for (i = 0; i < blocks_number; i++)
+    if (blocks[i].occupied)
+      {
+       blocks_used++;
+       large_mem_used += blocks[i].size;
+      }
+
   /* Emulate 'message', which writes to stderr in non-interactive
      sessions.  */
   fprintf (stderr,
-          "Dump memory usage: Heap: %" PRIu64 "  Large blocks(%lu): %" PRIu64 
"\n",
-          (unsigned long long)committed, blocks_number,
+          "Dump memory usage: Heap: %" PRIu64 "  Large blocks(%lu/%lu): %" 
PRIu64 "/%" PRIu64 "\n",
+          (unsigned long long)committed, blocks_used, blocks_number,
+          (unsigned long long)large_mem_used,
           (unsigned long long)(dumped_data + DUMPED_HEAP_SIZE - bc_limit));
 }
 #endif


reply via email to

[Prev in Thread] Current Thread [Next in Thread]