if you want to fix the memory leak directly in the non-trunk, ive attached a patch which is essentially just "lib/sqlalchemy/ attributes.py" diffed from 0.1.6 to the trunk.

Attachment: attributes.py.patch
Description: Binary data



if you want to look into the types thing, custom types that extend the base types have to use TypeDecorator again, like this:

class MyDecoratedType(types.TypeDecorator):
    impl = String
    def convert_bind_param(self, value, engine):
        return "BIND_IN"+ value
    def convert_result_value(self, value, engine):
        return value + "BIND_OUT"
    def copy(self):
        return MyDecoratedType()

notice the "impl=String" class variable there.

also, the Unicode and PickleType in the types module is already a TypeDecorator, so those can be extended directly.

On May 3, 2006, at 7:35 AM, Florian Boesch wrote:

I'm somewhat in a tight spot here, is there any specific change which I can get without all the rest that fixes the object issue? (i.e. I don't really have time to go chasing after trunk problems on general principle at the moment)

Quoting Michael Bayer <[EMAIL PROTECTED]>:
ah...are you using any custom types ?   unfornately I had to shake up
the interface for the TypeEngine object again.  otherwise, yes id
need more detail since all the unit tests pass.

On May 2, 2006, at 4:01 PM, Florian Boesch wrote:

Mike, thx

True, for the simple example it worked, but now I get an exception
for my
application code.

File "build/bdist.linux-i686/egg/sqlalchemy/engine.py", line 868, in
__getattr__
  File "build/bdist.linux-i686/egg/sqlalchemy/engine.py", line 812,
in _get_col
  File "build/bdist.linux-i686/egg/sqlalchemy/types.py", line 57,
in engine_impl
    ClassType = type(_C)
  File "build/bdist.linux-i686/egg/sqlalchemy/types.py", line 70,
in copy
    try:
NotImplementedError

Do you need more detail, should I try to isolate what usage leads
up to this?

Cheers, Florian

Quoting Michael Bayer <[EMAIL PROTECTED]>:
download the trunk and you will see your memory usage is steady as a
rock.

- m

On May 2, 2006, at 7:04 AM, Florian Boesch wrote:

Hi,

Since more then one processes modifies my database I invoke
objectstore.clear()
prior to fetching data I need to display.

I noticed that I have a huge objectleak all around (about 10k
objects never get
collected at every request)

I wrote a testprogramm (atached) wich in a nutshell does
while 1:
  select
  objectstore.clear()
  gc.collect()
  print len(gc.get_objects())

The numbers rolling down my screen never stabilize or decrease
until the
processes gets an out of memory exception.

However when I take the objectstore.clear() out, the number is
constant (this is
not a solution for me, see first paragraph).

I also noticed that this doesn't happen on windows, only on linux.

I'm using:
cxOracle
Python 2.4
RedHat EL4
sqlalchemy 0.1.6

Cheers, Florian
<objectleak.py>






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services,
security?
Get stuff done quickly with pre-integrated technology to make your
job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
http://sel.as-us.falkag.net/sel?
cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users





Reply via email to