Back to index

enigmail  1.4.3
Functions
build.link Namespace Reference

Functions

def measure_vsize_threadfunc
def measure_link_vsize

Function Documentation

def build.link.measure_link_vsize (   output_file,
  args 
)
Execute |args|, and measure the maximum virtual memory usage of the process,
printing it to stdout when finished.

Definition at line 57 of file link.py.

00057 
00058 def measure_link_vsize(output_file, args):
00059     """
00060     Execute |args|, and measure the maximum virtual memory usage of the process,
00061     printing it to stdout when finished.
00062     """
00063     proc = subprocess.Popen(args)
00064     t = threading.Thread(target=measure_vsize_threadfunc,
00065                          args=(proc, output_file))
00066     t.start()
00067     # Wait for the linker to finish.
00068     exitcode = proc.wait()
00069     # ...and then wait for the background thread to finish.
00070     t.join()
00071     return exitcode

def build.link.measure_vsize_threadfunc (   proc,
  output_file 
)
Measure the virtual memory usage of |proc| at regular intervals
until it exits, then print the maximum value and write it to
|output_file|.

Definition at line 43 of file link.py.

00043 
00044 def measure_vsize_threadfunc(proc, output_file):
00045     """
00046     Measure the virtual memory usage of |proc| at regular intervals
00047     until it exits, then print the maximum value and write it to
00048     |output_file|.
00049     """
00050     maxvsize = 0
00051     while proc.returncode is None:
00052         maxvsize, vsize = procmem.get_vmsize(proc._handle)
00053         time.sleep(0.5)
00054     print "linker max virtual size: %d" % maxvsize
00055     with open(output_file, "w") as f:
00056         f.write("%d\n" % maxvsize)