help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] Strategy to finding memleaks


From: Holger Hans Peter Freyther
Subject: Re: [Help-smalltalk] Strategy to finding memleaks
Date: Sat, 09 Apr 2011 13:49:10 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.9

On 04/09/2011 01:37 PM, Paolo Bonzini wrote:
> On Sat, Apr 9, 2011 at 12:14, Holger Hans Peter Freyther
> <address@hidden> wrote:
>> Okay with ObjectMemory globalGarbageCollect; compact. all these objects will
>> be removed. But without these the VM looks like it will go OOM as it is
>> finalizing these objects but not removing them from memory.
> 
> That's strange but possible. Do you do anything except "run a lot of queries"?

I just execute the script below. In the case where I found this I was using
the result to determine how many rows where affected (to see if the update was
successful or failed).

Do you have a hint of where I could look in oop.c? In your mental model what
should happen?



Eval [
    | top |

     PackageLoader fileInPackage: 'DBD-PostgreSQL'.

    top := DBI.Connection
            connect: 'dbi:PostgreSQL:dbname=DB;hostname=localhost'
            user: 'USER' password: 'PW'.

    [
    [
        top select: 'SELECT * FROM version()'.
    ] repeat.

    ] ensure: [
        | ops o |
        ObjectMemory globalGarbageCollect.
        ObjectMemory compact.

        ops := DBI.PostgreSQL.PGResultSet someInstance.
        [ops isNil] whileFalse: [
                [o := ops allOwners.
                 o isEmpty printNl. o size < 2] whileTrue: [
                        ops := ops nextInstance ].

                [ o printNl. ] on: Error do: ['Already finalized?' printNl].
                ops := ops nextInstance. ops isNil].
    ].
]




reply via email to

[Prev in Thread] Current Thread [Next in Thread]