Python占用内存脚本
#!/usr/bin/python
#coding=utf-8
from ctypes import *
import time
def eatMem(size,times):
mem = create_string_buffer(size*1024*1024*1024)
time.sleep(times)
mem= None
if __name__=='__main__':
print './xx {占用内存的大小,单位G} {持续时间,单位}\n如:./xx 10 60'
import sys
size= int(sys.argv[1])
times= int(sys.argv[2])
#print type(size),type(time)
eatMem(size,times)