[Zope] MemoryError: out of memory

Tres Seaver tseaver at palladion.com
Thu Jan 27 11:12:31 EST 2011

Hash: SHA1

On 01/26/2011 03:19 PM, Jonathan Salazar Santos wrote:
> Hi Comunity,
> I have been in troubles with Zope2.10.5-final since 4 moths ago,
> related to the "MemoryError: out of memory" (in the event.log), every
> three or fourth days (more or less) the Zope starts to say in our web:
> value error: Memory, and stops to serve some pages (not all), usually
> the pages that serve file contents (to download, convert to pdf or
> view online). I solve the problem (when appears) by rebooting the zope
> server, but its not a solutions, because I dont know when the error
> its coming ¿Can you help me to giving me some light to solve the
> problem? I have 2gb of RAM, and the server (FreeBSD) it says
> no-overloaded, just have 2 services, web(zope) and database(mysql). I
> think its something related to the cache memory or kind of (I changed
> some values in config file but not success). See some of my event.log
> Traceback (innermost last):
>   Module ZPublisher.Publish, line 119, in publish
>   Module ZPublisher.mapply, line 88, in mapply
>   Module ZPublisher.Publish, line 42, in call_object
>   Module OFS.DTMLMethod, line 144, in __call__
>    - <DTMLMethod at /xxxx/index_html used for /xxxx/suscribete/adminNewsletter>
>    - URL: http://xxxx/index_html/manage_main
>    - Physical Path: /xxxx/index_html
>   Module DocumentTemplate.DT_String, line 476, in __call__
>   Module OFS.DTMLMethod, line 137, in __call__
>    - <DTMLMethod at /xxxx/suscribete/adminNewsletter/third_header>
>    - URL: http://xxxx/suscribete/adminNewsletter/third_header/manage_main
>    - Physical Path: /xxxx/suscribete/adminNewsletter/third_header
>   Module DocumentTemplate.DT_String, line 476, in __call__
>   Module DocumentTemplate.DT_In, line 703, in renderwob
>   Module Products.MailHost.SendMailTag, line 114, in render
>   Module Products.MIMETools.MIMETag, line 198, in render
>   Module MimeWriter, line 177, in lastpart
> MemoryError: out of memory

The "aliases" feature of the stock Shared.DC.ZRDB.Results.Results class
has a leak, due to an uncollectable cycle created between the alias
objects and the record class generated *for each query*.  If your app
makes heavy use of stock ZSQL methods, you are probably going to have to
plan to monitor the server's RAM usage and reboot as it gets close to
the limit.

If you are confident either that your application does not need the
alias feature (your SQL queries all spell the column names using the
"canonical" spelling for your SQL server), or that you can modify them
to do so, you might try applying the attached patch, which removes the
aliase feature.

- -- 
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlmethods-no_aliases.diff
Type: text/x-patch
Size: 1195 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20110127/731f9ba7/attachment.bin 

More information about the Zope mailing list