Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory use of ActiveX exe server - very strange

1 view
Skip to first unread message

Ophir

unread,
Feb 7, 2005, 7:29:36 AM2/7/05
to
Hello

I have an ActiveX exe with Thread per object set so each object will
reside in it's own thread.

Now, when creating the objects I can see the thread count of the
process increase and when they are destroyed I can see the thread count
decrease and reach it's starting point after all objects were
destroyed. How ever the memory that the process use remain high much
more then it's initial value.
Since I thought this is a memory leak in my code, I looked for a
possible error that will cause this, but could not found one.

So I went and wrote an ActiveX exe - with Thread per object option -
that expose one object type that does nothing with no properties and no
data members simply an empty object.

I started a few of that object and as before I could see the thread
count increase and decrease as objects were created/destroyed but again
the memory used by the process did not decrease to it's initial value
after all objects were destroyed. It stays much higher - for example
init value 5000K, after 1000 objects were created/destroyed - 20000K.

This scenario - to my knowledge - rule out the possibility of memory
leaks.

Can someone tell me if it is normal, and why this happens?

Tony Proctor

unread,
Feb 9, 2005, 5:02:05 AM2/9/05
to
How are you measuring the memory usage Ophir? Details from Task Manager can
be misleading for instance.

Tony Proctor

"Ophir" <oph...@netvision.net.il> wrote in message
news:1107779376....@l41g2000cwc.googlegroups.com...

Ophir

unread,
Feb 9, 2005, 8:18:47 AM2/9/05
to
It is only what I see in the task manager.

Tony Proctor

unread,
Feb 9, 2005, 10:57:37 AM2/9/05
to
...but what are you looking at. Task Manager can show a range of items for a
process. If, for instance, you're looking at 'VM Size' then that merely
reflects the size of virtual memory for the whole process. The heap manager
may be hanging on to freed memory in order to service new allocation
requests.

Run your test a few times and see how the 'Mem Usage, 'Page Faults', and 'VM
Size' over a longer period of time.

Tony Proctor

"Ophir" <oph...@netvision.net.il> wrote in message

news:1107955127.9...@o13g2000cwo.googlegroups.com...

Ophir

unread,
Feb 10, 2005, 2:01:42 PM2/10/05
to
Well I'm refering to the Mem usage item.
I expect it will drop back to starting point after objects were
destroyed but thats not the case.
I run it for several times on several computers and it's basicaly the
same.

Tony Proctor

unread,
Feb 11, 2005, 6:25:55 AM2/11/05
to
What I'm saying is that it will never drop back completely. However, it
shouldn't increase consistently either. If you do what I suggested and it
doesn't reach a steady state (i.e. still increasing by the same amount) then
you have a possible memory leak, or object-cleanup problem

Tony Proctor

"Ophir" <oph...@netvision.net.il> wrote in message

news:1108062102.1...@c13g2000cwb.googlegroups.com...

0 new messages