🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #9245

Re: Thread and memory

#9245
From: Sara T.
Date: Tue, 20 Jul 2004 07:13
34 lines
2292 bytes
"Remy Lebeau (TeamB)" <gambit47.no.spam@no.spam.yahoo.com> wrote in message
news:40fcb75c$1@newsgroups.borland.com...
>
> "Sara T." <sarana@infoquest.co.th> wrote in message
> news:40fcab00@newsgroups.borland.com...
>
> > I thought when I set FreeOnTerminate to true, thread should
> > be cleared and free up memory but the pointer of object
> > MyThread, need it to be cleared?

Although I call a lot of times as following:

1: for (int i=0; i<Queue->Count(); i++) {
2:   CMyThread *MyThread = new MyThread();
3:   MyThread->Resume();
4: } /* for */

>
> The thread object itself is freed, but the pointer that points to the
object
> does not been to be cleared unless you have other code that still uses
that
> pointer for other purposes.
>
> > In fact the line number 1: has been called a lot of times and
> > I thought that it should be OK if it is a thread with using
> > FreeOnTerminate.
>
> In the example you have shown, it is fine.
I observe again and fould usually Virtual Memory has nerver been decreased.
it takes 500MB and adding a Physical Memory 350 MB, that's all around 1GB.
It makes a resource of the machine unusually and found the error "Thread
creation error: Not enough storage is available to process this command"
Technical Details
Message-ID: <40fcc5b3@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcb75c$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d35c53850c011fac
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Sara T." <sarana@infoquest.co.th>
Newsgroups: borland.public.cppbuilder.nativeapi
References:  <40fb3d08@newsgroups.borland.com> <40fbf87b$1@newsgroups.borland.com> <40fbfd74$1@newsgroups.borland.com> <40fc1022$1@newsgroups.borland.com> <40fcab00@newsgroups.borland.com> <40fcb75c$1@newsgroups.borland.com>
Subject: Re: Thread and memory
Date: Tue, 20 Jul 2004 14:13:54 +0700
Lines: 36
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 169.210.34.33
Message-ID: <40fcc5b3@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1090307507 169.210.34.33 (20 Jul 2004 00:11:47 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!gatel-ffm!gatel-ffm!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail