Help with memory leak

156 views
Skip to first unread message

DNeuman

unread,
Jun 18, 2016, 8:47:43 AM6/18/16
to web2py-users
I'm having trouble running Web2py on Mac OS X 10.11.5  El Capitan - the memory consumed by Web2Py just keeps growing. Left overnight it crashes my application, corrupts my tables, and creates an unrecoverable mess.

I have uninstalled, and loaded a new download. This didn't work. Running from a new download Mac binary with nothing running but the server shows memory leak at a very consistent 3.4MB/minute.

No applications running - just download, and start the server.

If I download source and run from python 2.7.11, I get a slow memory leak (1.1MB/minute before the server is started, 2.5MB/sec when the server is started). Note: I am not running anything. No applications, no code of my own, nothing but the server. How can I fix this? Has anyone else experienced this? I suspect OS X, so I ran just python, with no program at all, and this is stable, with no memory leak.

Any hints what I can do next to try to fix this?

Thanks!

Anthony

unread,
Jun 18, 2016, 1:06:57 PM6/18/16
to web2py-users
If I download source and run from python 2.7.11, I get a slow memory leak (1.1MB/minute before the server is started, 2.5MB/sec when the server is started).

This sounds suspicious. How can web2py be causing a memory leak if you are not running it? Are you suggesting that if you merely download the web2py source code onto your computer but do absolutely nothing with it, a memory leak mysteriously materializes?

Anthony

Julian Sanchez

unread,
Jun 20, 2016, 6:34:51 AM6/20/16
to web2py-users
I can relate to that behavior as I also see a memory usage increase from just running web2py, but I don't know if it's the same thing as what was described by the OP.

OS X El Capitan
Python 2.7.10  (default, Sep 23 2015, 04:34:21)

[GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.72)] on darwin

Web2py Version 2.14.6-stable+timestamp.2016.05.10.00.21.47

If I just type 'python web2py.py' on a terminal window I do see the python process in activity monitor show an increasing memory allocation right away.  I don't even need to click the 'start server' button on the web2py dialog that shows up after typing the python command.  Every time activity monitor refreshes the entry (once every 2 seconds?) I see the memory allocated to the python process to increase by a megabyte or 2.

Doesn't really cause a major issue on my side.  I can run my web2py apps and for days.  I never see any crashes.  Of course after a few days the python process has allocated a few gigabytes of memory (sometimes over 9 gb) and by then the computer is using the swap file for everything so overall performance is very poor.  Quick restart of the python process cures the problem, at least for a few more days until I'm back at the same situation of high memory utilization.
But again I've never seen any application crashes on my side nor I run anything in production mode so this has never bothered me.  I always thought I had something configured improperly.

Hope this helps,
Julian

Anthony

unread,
Jun 20, 2016, 7:29:04 AM6/20/16
to web2py-users
On Saturday, June 18, 2016 at 1:06:57 PM UTC-4, Anthony wrote:
If I download source and run from python 2.7.11, I get a slow memory leak (1.1MB/minute before the server is started, 2.5MB/sec when the server is started).

This sounds suspicious. How can web2py be causing a memory leak if you are not running it? Are you suggesting that if you merely download the web2py source code onto your computer but do absolutely nothing with it, a memory leak mysteriously materializes?

Oh, I guess you meant starting the GUI without starting the server. What happens if you start the server via the command line rather than the GUI -- same thing?

Note, I do not see this problem on Windows.

Anthony

Julian Sanchez

unread,
Jun 20, 2016, 7:22:08 PM6/20/16
to web2py-users
Well, this is interesting...

When starting the server via the command line I don't see any memory increase.  However:
- When starting via command line the process name that shows in activity monitor is 'python2.7'
- When starting the GUI (with the corresponding memory increase) the name of the process that shows in activity monitor is 'python'

Julian

Anthony

unread,
Jun 20, 2016, 7:27:05 PM6/20/16
to web2py-users
In both cases, are you running Python from source, or is the GUI case with the Mac binary?

Anthony

Julian Sanchez

unread,
Jun 21, 2016, 5:50:57 AM6/21/16
to web2py-users
Both cases it's done from source

Cheers,
Julian

DNeuman

unread,
Jul 2, 2016, 1:51:41 AM7/2/16
to web2py-users
Sorry I have not had time to respond quickly - I encountered the same thing as Julian.

Running from Source shows the task with memory growth: 'python'  this is expected, because this was started from the terminal. Python 2.7.11 Gcc 4.2.1
Running from Binary shows the task with memory growth: 'web2py' this is also expected, because this was started from the Mac Binary itself.

I had to mess around a while with this, and eventually removed a malware scanning tool. When I did this, the memory growth slowed. Still there, but the system is usable again.

OS X El Capitan 10.11.5
Web2Py 2.14.6-stable+timestamp.2016.05.10.00.21.47
memory growth of about 2MB/minute.


Then I got an older Mac, and ran the app on an earlier version of Mac OS X - interesting - NO memory growth!
OS X 10.9.5

So there is some issue with the latest OS X interacting with Web2Py both the source and the binary versions.

DNeuman

unread,
Jul 2, 2016, 1:56:55 AM7/2/16
to web2py-users
I tried from source and saw the memory growth on OS X El Capitan.
I tried from the Mac binary and saw the memory growth on OS X El Capitan.  (this is without even starting the server). Just double click web2py in finder.



On Monday, June 20, 2016 at 4:27:05 PM UTC-7, Anthony wrote:

tim spear

unread,
May 27, 2020, 12:56:16 AM5/27/20
to web2py-users
Hi

Here I am in 2020 using High Sierra 10.13.6 having the same issue.
I've tried various versions of web2py with Python 2.7 and the latest version with Python 3.7
and all seem to have the issue - memory use starts around 37mb and then ticks up a few mb/min. I'm downloading the source and then typing >python web2py.py in the terminal.

Did anyone come up with a solution? 

Thanks

Dave S

unread,
May 30, 2020, 5:45:31 AM5/30/20
to web2py-users
3


On Tuesday, May 26, 2020 at 9:56:16 PM UTC-7, tim spear wrote:
Hi

Here I am in 2020 using High Sierra 10.13.6 having the same issue.
I've tried various versions of web2py with Python 2.7 and the latest version with Python 3.7
and all seem to have the issue - memory use starts around 37mb and then ticks up a few mb/min. I'm downloading the source and then typing >python web2py.py in the terminal.

Did anyone come up with a solution? 

Thanks


What database are you using, and what driver for the DB?

/dps
Reply all
Reply to author
Forward
0 new messages