You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Hi,
I noticed a possible memory leak while moving our application to
production server.
Problem is simplified below as much as possible:
#--- db.py ---
db = DAL('mysql://root:root@localhost/memory_test', pool_size=0)
db.define_table('test_table',
SQLField('description'))
#--- end of file ---
#--- mem_test.py ---
while (True):
record = db.test_table[1]
#---- end of file ---
I inserted one record to test_table.
Background process is started:
python2.6 web2py.py -S Memory_test -M -N -R applications/Memory_test/
private/mem_test.py
Now if one monitors memory usage of the script is seems to steadily
consume more and more memory.
Guppy showed the same thing.
For test purposes I tried gc.collect() inside the while loop but it
did not help.
Also added db.commit() inside the loop just in case if that might do
the trick.
Am i completely missing something obvious or is this an actual bug?
Ubuntu 8.04
Web2py: Version 1.95.1 (2011-04-25 15:04:14)
Python2.6
- Kimmo
Massimo Di Pierro
unread,
Jun 22, 2011, 10:16:57 AM6/22/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to web2py-users
Try adding this inside the loop:
db._timings = []
web2py logs all sql statements in db._timings This would cause a
memory leak but I would expect it to be negligible.