]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Print a more helpful set of messages when we've run out of memory.
authorJulian Seward <jseward@acm.org>
Sat, 24 Aug 2002 09:47:18 +0000 (09:47 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 24 Aug 2002 09:47:18 +0000 (09:47 +0000)
MERGE TO HEAD

git-svn-id: svn://svn.valgrind.org/valgrind/branches/VALGRIND_1_0_BRANCH@631

vg_mylibc.c

index 8769cf1710e409c856ecd297388a6a3f2a14c0c0..2f2c0998a773c83245c83392711df19291097eef 100644 (file)
@@ -1275,9 +1275,23 @@ void* VG_(get_memory_from_mmap) ( Int nBytes, Char* who )
             tot_alloc, nBytes, p, ((char*)p) + nBytes - 1, who );
       return p;
    }
-   VG_(printf)("vg_get_memory_from_mmap failed on request of %d\n", 
+   VG_(printf)("\n");
+   VG_(printf)("VG_(get_memory_from_mmap): request for %d bytes failed.\n", 
                nBytes);
-   VG_(panic)("vg_get_memory_from_mmap: out of memory!  Fatal!  Bye!\n");
+   VG_(printf)("VG_(get_memory_from_mmap): %d bytes already allocated.\n", 
+               tot_alloc);
+   VG_(printf)("\n");
+   VG_(printf)("This may mean that you have run out of swap space,\n");
+   VG_(printf)("since running programs on valgrind increases their memory\n");
+   VG_(printf)("usage at least 3 times.  You might want to use 'top'\n");
+   VG_(printf)("to determine whether you really have run out of swap.\n");
+   VG_(printf)("If so, you may be able to work around it by adding a\n");
+   VG_(printf)("temporary swap file -- this is easier than finding a\n");
+   VG_(printf)("new swap partition.  Go ask your sysadmin(s) [politely!]\n");
+   VG_(printf)("\n");
+   VG_(printf)("VG_(get_memory_from_mmap): out of memory!  Fatal!  Bye!\n");
+   VG_(printf)("\n");
+   VG_(exit)(1);
 }