🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.multi-tier
Article #1231

Re: Memory usage increase using TClientDataSet as a local temporary dataset

#1231
From: Kim Madsen
Date: Thu, 13 Apr 2000 00:00
83 lines
3188 bytes
Hi,

I believe the problem has to do with versioning of TClientDataset. Every
change you make probably adds a new version of the record. Only when you
clearout the table or 'resolve' the changes, the versions are deleted.

In TkbmMemTable you can control just how many versions should be kept on
change (1 or all) or if versioning should be used at all.

You definitely ought to join the memtable community at:
http://www.onelist.com/community/memtable to checkout the latest
versions (2.38 is latest release) and participate in the discussions of
using and enhancing it.

best regards

Kim Madsen
kbm@optical.dk
Author of TkbmMemTable

In article <8cv4sm$mj41@bornews.borland.com>,
  "Girts" <girts@vivasport.lv> wrote:
> Hi,
> I am using TClient DataSet to store a results of calculations to be
used in
> reports, etc. I have noticed program memory usage increase, when
> TClientDataSet is updated many times (thousands). I created a small
example
> to demonstrate the problem. CDS is a TClientDataSet containing only
one
> integer data field Aaa.
>
>   CDS->CreateDataSet();
>   CDS->LogChanges = false;
>   for ( int i = 1; i < 10000; i++) {
>      CDS->Append();
>      CDS->FieldByName("Aaa")->AsInteger = i;
>      CDS->Post();
>   }
>   for ( int i = 1; i <= 10; i++) {
>       CDS->First();
>       while (!CDS->Eof) {
>          CDS->Edit();
>          CDS->FieldByName("Aaa")->AsInteger =
> CDS->FieldByName("Aaa")->AsInteger + 1;
>          CDS->Post();
>          CDS->Next();
>       }
>   }
>
> Basically in a second for loop (on update of a field value) program
memory
> usage increases by 64Kb per loop according to NT task manager. I tried
this
> on 2 NT PC's and one Win98...
> I tested the same example with CB5 trial and it works correctly (no
memory
> increase reported). Is this a known problem?
> Also I have a similar effect using statement like
>   CDS->FieldByName("Aaa")->AsInteger += 1;
> increasing memory usage as opposed to (which does not)
>   CDS->FieldByName("Aaa")->AsInteger =
CDS->FieldByName("Aaa")->AsInteger +
> 1;
> This problem still exists in CB5 trial as well.
>
> I am considering swithing to kbMemTable to use as a temporary dataset,
but
> my trust in TClientDataSet, which I like a lot is kind of damaged...
> I am using CBuilder4 with Service Pack 2.
> Any solutions?
>
> Girts
>
>

--
Kim Madsen
kbm@optical.dk


Sent via Deja.com http://www.deja.com/
Before you buy.
Technical Details
Message-ID: <8d55f0$26t$1@nnrp1.deja.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <8cv4sm$mj41@bornews.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fcd2b,49a90407f34ccd9a
X-Google-Attributes: gidfcd2b,public
From: Kim Madsen <kbm@optical.dk>
Subject: Re: Memory usage increase using TClientDataSet as a local temporary dataset
Date: 2000/04/13
Message-ID: <8d55f0$26t$1@nnrp1.deja.com>
X-Deja-AN: 610775139
References: <8cv4sm$mj41@bornews.borland.com>
X-Http-Proxy: 1.0 x36.deja.com:80 (Squid/1.1.22) for client 194.234.33.22
Organization: Deja.com - Before you buy.
X-Article-Creation-Date: Thu Apr 13 18:59:53 2000 GMT
X-MyDeja-Info: XMYDJUIDkimbomadsen
Newsgroups: borland.public.cppbuilder.database.multi-tier
X-Http-User-Agent: Mozilla/4.7 [en] (Win95; I)