ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> zodb-dev
zodb-dev
Re: [ZODB-Dev] Cache Query (why doesn't RAM usage ever drop?)
by Toby Dickenson other posts by this author
Oct 30 2002 3:32PM messages near this date
Re: [ZODB-Dev] Cache Query (why doesn't RAM usage ever drop?) | Re: [ZODB-Dev] Cache Query (why doesn't RAM usage ever drop?)
On Wednesday 30 October 2002 2:00 pm, Chris Withers wrote:

>  Hmmm, I'm actually using the Alpha here, did you fix it up after that?

no. Ill spam you off-list about this.

>  > A malicious script? yes.  I think this is a bogus argument for a change
>  > to ZODB; a malicious script could also bring the server down by creating
>  > large numbers of non-persistent objects
> 
>  Not malicious, consider this:
> 
>  for brain in context.some_catalog(an_index='fish'):
>     object = brain.getObject()
>     object.doSomeMaintenence()
> 
>  ...now if an_index goes walkies, you've just loaded all the obejcts you've
>  cataloged into memory by mistake.

Yes. IMO this script *needs*:

1. either batching, as is traditional for a search results page. The search 
might be huge, but memory useage will be controlled if the batch size is 
reasonable:

2. or a garbage collection tickler as part of the loop. See ZCatalog's 
"reindex all" implementation for an example.

>  Can you do either of those from Script (Python)'s?

Probably not, but I dont do much ttw work.

>  > The problem is not the hardness of the limit, but rather that the limit
>  > is applied at the right time. Any automatic enforcement mid-transaction
>  > is liable to cause problems (for example, think about _v_ attributes)
> 
>  how would raising a MemoryError (as happens when you run of RAM for real)
>  affect these?

Not a bad idea. This could be done easily and efficiently in Connection.py

Of course it still doesnt help with the case of memory usage by non-persistent 
objects.

>  > I can suggest a change to your indexing loop that will make this happen
>  > automatically. Would that help? ; -)
> 
>  What would the change be?

sys.exit(1)

;-)



_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@[...].org
http://lists.zope.org/mailman/listinfo/zodb-dev
Thread:
Chris Withers
Chris Withers
Chris Withers
Toby Dickenson
Chris Withers
Toby Dickenson
Toby Dickenson
Shane Hathaway
Shane Hathaway
Shane Hathaway
Christian Reis
Tim Peters
Chris Withers
Chris Withers
Chris Withers
Shane Hathaway
Shane Hathaway
Shane Hathaway
Toby Dickenson
Jeremy Hylton
Tim Peters

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved