RE: [Zope] Zope Eats Memory
Are you using REQUEST.set() a lot? I am (my presentation code, unfortunately, uses these quite aggressively). I have dtml that wraps other DTML "core" presentation widgets, and I use <dtml-var "REQUEST.set('foo', '')"> a lot. Does anyone know if there is another, more graceful, way to pass parameters from a wrapping dtml method to a dtml method it calls? Also, slightly related, as I eventually plan to migrate this particular site to ZPT: are there any issues with reference leaks with tal:define similar to REUQEST.set() calls? Sean -----Original Message----- From: Chris Gray [mailto:cpgray@library.uwaterloo.ca] Sent: Thursday, October 25, 2001 11:14 AM To: Peter Bengtsson Cc: zope@zope.org Subject: Re: [Zope] Zope Eats Memory Aside from ZEO, I'm using only the Debian packages for Zope 2.3.3 and ZMySQLDA. Chris On Thu, 25 Oct 2001, Peter Bengtsson wrote:
Are you using the Photo product? The "old" one. I've got a product based on the Photo product, and I'm starting to suspect
that there is something wrong there that eats memory. Just checking.
At 11:41 2001-10-25 -0400, you wrote:
I've been running Zope (with ZEO) on a Debian GNU/Linux box. Just today everything slowed to a crawl and it turned out that one python process was taking up 75% of system memory. Stopping and restarting Zope cured the problem. I'm doing some caching of DTML pages and MySQL queries.
Any idea why Zope would start doing this? Are there any preventative measures?
Thanks, Chris
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Are you using REQUEST.set() a lot? I am (my presentation code, unfortunately, uses these quite aggressively). I have dtml that wraps other DTML "core" presentation widgets, and I use <dtml-var "REQUEST.set('foo', '')"> a lot.
Does anyone know if there is another, more graceful, way to pass parameters from a wrapping dtml method to a dtml method it calls?
If you find it, please let me know. I'm beginning to miss ColdFusion's variable scopes. ;-) I seem to find myself using REQUEST.set 95% of the time, instead of <dtml-let> generally because I want to pass variables around, or may need them somwhere later in the method. I hate having to do this, but .... Tommy Innovation: The Best Way To Predict The Future ... Is To Create It.
you can call a dtml-method like a function with parameters dtml-method 1 called callTest: <dtml-var standard_html_header> <dtml-var param1><br> <dtml-var param2><br> <dtml-var standard_html_footer> you call this method like so: <dtml-var "callTest(None,_,param1=21, param2='was called from far')"> Robert ----- Original Message ----- From: "Tommy Johnson" <tommy@7x.com> To: "Zope List" <zope@zope.org> Sent: Thursday, October 25, 2001 8:43 PM Subject: RE: [Zope] Zope Eats Memory
Are you using REQUEST.set() a lot? I am (my presentation code, unfortunately, uses these quite aggressively). I have dtml that wraps other DTML "core" presentation widgets, and I use <dtml-var "REQUEST.set('foo', '')"> a lot.
Does anyone know if there is another, more graceful, way to pass parameters from a wrapping dtml method to a dtml method it calls?
If you find it, please let me know. I'm beginning to miss ColdFusion's variable scopes. ;-) I seem to find myself using REQUEST.set 95% of the time, instead of <dtml-let> generally because I want to pass variables around, or may need them somwhere later in the method. I hate having to do this, but ....
Tommy Innovation: The Best Way To Predict The Future ... Is To Create It.
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
you can call a dtml-method like a function with parameters
dtml-method 1 called callTest: <dtml-var standard_html_header> <dtml-var param1><br> <dtml-var param2><br> <dtml-var standard_html_footer>
you call this method like so: <dtml-var "callTest(None,_,param1=21, param2='was called from far')">
Robert
Yes, I do that alot too. Thought it was preety cool when I first found out. Now, it's a lifesaver. But, I still need to set REQUEST variables, because they represent the parameters I'm passing. Your example: <dtml-var "callTest(None,_,param1=21, param2='was called from far')"> Mine: <dtml-var "REQUEST.set('departmentID', '17')"> <dtml-var "REQUEST.set('categoryID', '2')"> <dtml-var "REQUEST.set('productID', '21')"> <dtml-var "callTest(None,_,param1=departmentID, param2=categoryID, param3=productID)"> Usually, I'll need to set those variables before calling the method. That way not only is the method dynamic, but the actual call to the method is dynamic as well. Tommy Innovation: The Best Way To Predict The Future ... Is To Create It.
[Tommy Johnson]
Your example: <dtml-var "callTest(None,_,param1=21, param2='was called from far')">
Mine: <dtml-var "REQUEST.set('departmentID', '17')"> <dtml-var "REQUEST.set('categoryID', '2')"> <dtml-var "REQUEST.set('productID', '21')">
<dtml-var "callTest(None,_,param1=departmentID, param2=categoryID, param3=productID)">
Usually, I'll need to set those variables before calling the method. That way not only is the method dynamic, but the actual call to the method is dynamic as well.
You can also set variables with dtml-let. There is also a product called dtml-set that gives you the equivalent of Cold Fusion's <cfset> tag. I still can't believe that Zope doesn't have something like this as standard. I don't know if dtml-set has memory leak problems or not. Seems to me that you could unset the properties that you set in the REQUEST once you were done with them. That ought to release the referenced objects. Something like REQUEST.set('param1',None) Anyone know for sure if that would handle the memory leak problem with REQUEST.set()? Cheers, Tom P
Robert, You should replace "None" against "_.None" in a python expression inside a <dtml-something "..."> Dunno why but only this works for me (Zope 2.3.3). So write: <dtml-var "callTest(_.None,_,param1=21, param2='was called from far')"> ----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Tommy Johnson" <tommy@7x.com>; "Zope List" <zope@zope.org> Sent: Thursday, October 25, 2001 9:53 PM Subject: Re: [Zope] Zope Eats Memory
you can call a dtml-method like a function with parameters
dtml-method 1 called callTest: <dtml-var standard_html_header> <dtml-var param1><br> <dtml-var param2><br> <dtml-var standard_html_footer>
you call this method like so: <dtml-var "callTest(None,_,param1=21, param2='was called from far')">
LOL. Slight typo on that. You're right. ;-)
-----Original Message----- From: zope-admin@zope.org [mailto:zope-admin@zope.org]On Behalf Of Gilles Lenfant Sent: Thursday, October 25, 2001 12:24 PM To: Zope List Subject: Re: [Zope] Zope Eats Memory
Robert,
You should replace "None" against "_.None" in a python expression inside a <dtml-something "..."> Dunno why but only this works for me (Zope 2.3.3). So write:
<dtml-var "callTest(_.None,_,param1=21, param2='was called from far')">
----- Original Message ----- From: "Robert Rottermann" <robert@redcor.ch> To: "Tommy Johnson" <tommy@7x.com>; "Zope List" <zope@zope.org> Sent: Thursday, October 25, 2001 9:53 PM Subject: Re: [Zope] Zope Eats Memory
you can call a dtml-method like a function with parameters
dtml-method 1 called callTest: <dtml-var standard_html_header> <dtml-var param1><br> <dtml-var param2><br> <dtml-var standard_html_footer>
you call this method like so: <dtml-var "callTest(None,_,param1=21, param2='was called from far')">
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (5)
-
Gilles Lenfant -
Robert Rottermann -
sean.upton@uniontrib.com -
Thomas B. Passin -
Tommy Johnson