At 06.49 21/09/2007 +0900, [EMAIL PROTECTED] wrote:
[...]
There is still a problem without memory leaking, I think.
Let's assume that the program is increasing memory space continusly.
Let me clarify this by small example.

loop:
   1: get XML message
   2: create a parser
   3: parse
   4: do my job
   5. delete a parser.
   6. add small data to history list. Let's assume this requires 10B in
dynamic memory


How did you access the DOM tree generated by the parser? If you use adoptDocument(), it's your responsibility to release it (otherwise, if you use getDocument(), it will automatically deleted when you delete the parser).

Alberto

So we allocated 160KB in step 2 and deallocated it in step 5, but memory
used in step 6 may use the space returned by step 5. Then the same memory
space cannot be used for next iteration. By this fragmentation, OS will
not find any more big space for step 2 soon. Again this is only a guess.

HK


>
> Dave
>
>

Reply via email to