[pypy-svn] r57928 - in pypy/branch/cross-compilation/pypy/translator/benchmark: . memory

fijal at codespeak.net fijal at codespeak.net
Sun Sep 7 11:17:54 CEST 2008


Author: fijal
Date: Sun Sep  7 11:17:53 2008
New Revision: 57928

Modified:
   pypy/branch/cross-compilation/pypy/translator/benchmark/bench_mem.py
   pypy/branch/cross-compilation/pypy/translator/benchmark/memory/one.py
Log:
update docstring


Modified: pypy/branch/cross-compilation/pypy/translator/benchmark/bench_mem.py
==============================================================================
--- pypy/branch/cross-compilation/pypy/translator/benchmark/bench_mem.py	(original)
+++ pypy/branch/cross-compilation/pypy/translator/benchmark/bench_mem.py	Sun Sep  7 11:17:53 2008
@@ -1,5 +1,9 @@
 #!/usr/bin/env python
 """ Usage: bench_mem.py [-l log] program_name [arg0] [arg1] ...
+
+Run a program with given args under constant memory usage monitoring.
+Dump output (which is step & private memory used) into a file suitable
+for plotting with gnuplot.
 """
 import os
 import py

Modified: pypy/branch/cross-compilation/pypy/translator/benchmark/memory/one.py
==============================================================================
--- pypy/branch/cross-compilation/pypy/translator/benchmark/memory/one.py	(original)
+++ pypy/branch/cross-compilation/pypy/translator/benchmark/memory/one.py	Sun Sep  7 11:17:53 2008
@@ -1,4 +1,6 @@
 
+import gc
+
 class A(object):
     pass
 
@@ -7,8 +9,14 @@
         self.a = [1,2,3]
         self.b = "xyz"
 
-j = 0
-while j < 20:
-    x = [(A(), B()) for i in range(100000)]
-    del x
-    j += 1
+x = [(A(), B()) for i in range(100000)]
+gc.collect()
+
+while 1:
+    pass
+#j = 0
+#while j < 20:
+#    x = [(A(), B()) for i in range(100000)]
+#    del x
+#    gc.collect()
+#    j += 1



More information about the Pypy-commit mailing list