Brondo, Greg wrote: > Thanks to Jay Love for all his help. Here's the current situation: > > 1) If I do not catch exceptions, it appears the thread dies > and restarts > but the memory is never freed. With a high volume app it can > consume much > memory very quickly (I ate 3.5 GB in less than 5 hours). > Since I've added > try/except blocks this problem is fixed.
WebKit is designed to catch all exceptions that are generated in servlets. The thread doesn't die and restart -- it just catches the exception, sends a formatted traceback back to the client, and then put itself back into the pool of threads. So you are finding that WebKit leaks memory whenever any unhandled exception happens in a servlet? I'll do some testing to see if I can reproduce it here. > 2) Using DCOracle2 (from Zope) or cx_Oracle, after a large query is > performed (and fetchall() ) the memory is not freed. This is > the case even > if I call a garbage collection (gc.collect() ). I created a > small script to > test this behaviour. It's doesn't leak memory, it just > doesn't free up from > the last query. Memory usage will stay at whaever the last > largest query > run generated. This is my current problem. I think this is normal Python behavior and it's actually normal C behavior also. When you use malloc() to allocate a bunch of smallish blocks of memory, once you free() the memory, it doesn't go back to the operating system, but instead it remains available to be allocated by another call to malloc(). (This behavior may be different if you malloc() large blocks of memory.) If this is a problem, then I would just avoid using fetchall() on large queries. Either fetch a smaller number of rows at a time using fetchmany(), or limit the number of rows returned in your queries (that would be with a TOP clause in SQL Server, I assume Oracle has the same feature). - Geoff _______________________________________________ Webware-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-devel
