mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-14 13:06:34 +03:00
12 lines
315 B
Python
12 lines
315 B
Python
import psycopg2
|
|
import threading, os, time, gc
|
|
|
|
for i in range(20000):
|
|
conn = psycopg2.connect('dbname=test')
|
|
del conn
|
|
if i%200 == 0:
|
|
datafile = os.popen('ps -p %s -o rss' % os.getpid())
|
|
line = datafile.readlines(2)[1].strip()
|
|
datafile.close()
|
|
print str(i) + '\t' + line
|