|
Didn't you googled yet, did you [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
caoctaviano wrote: That's why I need a garbage collector for BCB 6.
But why do you need one? I have never heard of a technical requirement for GC, only political requirements. The only reason I ask is in case you have real requirements that would be satisfied using Placement new.
|
|
|
|
|
No option to create yourself?
|
|
|
|
|
Garbage collectors don't work well outside a managed environment and especially in C/C++. Using smart pointers and just writing classes correctly gets you most the way there. While the above reply may be sarcastic, it's correct: if you want garbage collection, you should be using a managed environment.
(I think garbage collection is way overrated. The biggest problems I encounter in a related area are resource leaks, not memory leaks, and garbage collection does a piss poor job at that, especially in .NET. There is too much terrible code out there where developers say "the garbage collector will handle it".)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
You could try the Boehm GC[^] - I've never used it, but I've seen good things written about it - and Hans Boehm is involved with efforts to add GC to the C++ Standard (NOT in C++0x, though).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I've downloaded the Boehm GC but I don't know how to use it in BCB6.
Also I've downloaded the library LibGC from this website (http://www.codeproject.com/KB/cpp/agm_libgc.aspx). This library seems easy to be used.
However when I include the gc.hpp in the BCB project and try to compile, it shows me the following error:
[C++ Error] gc.hpp(101): E2238 Multiple declaration for 'Object::operator delete(void *)'
[C++ Error] gc.hpp(84): E2344 Earlier declaration of 'Object::operator delete(void *)'
Does anyone know how to fix theses errors ?
|
|
|
|
|
Not for Borland C++
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Look at this interesting thing...
If I minimize the program which is using about 16000K of memory, the memory usage reduces to about 4000K.
Is the Windows Task Manager reliable to check the memory usage ?
Somebody told me that it is not the correct place to check it because the windows task manager doesn't show the memory usage of an application. It only shows its "working set", which is the memory reserved by Windows to my application.
He also told me that the Windows changes the "working set" as it believes that it is needed to review the balance.
Do you guys suppose it is correct ?
If not, how can I measure the real memory usage of my application ?
And how could I check if my application has any kind of memory leak issue ? Is there any tool to check it for C++ Builder ?
|
|
|
|
|
caoctaviano wrote: Somebody told me that it is not the correct place to check it because the windows task manager doesn't show the memory usage of an application. It only shows its "working set", which is the memory reserved by Windows to my application.
He also told me that the Windows changes the "working set" as it believes that it is needed to review the balance.
I agree.
The outside world knows how much memory the app holds, not how much it uses, the app itself (and its GC, if it has one) is the only one to know that.
Luc Pattyn [Forum Guidelines] [My Articles]
DISCLAIMER: this message may have been modified by others; it may no longer reflect what I intended, and may contain bad advice; use at your own risk and with extreme care.
|
|
|
|
|
If you were using Visual C++, I'd point you at the C runtime or MFC leak detection support, or CodeProject's very own Visual Leak Detector[^]. As you're not...mmmmm. Tricky. Commercial options, obviously - Purify[^] or BoundsChecker[^] or AQTime[^] (memory checker AND profiler!). If you were using Linux, there's valgrind[^]. OS X? MallocDebug, leaks[^] or Instruments[^].
BCB on WIndows...mmmm - I really don't know!
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I've downloaded the trial version of AQTime v6 to check the memory usage and I've noticed that the item "Reserved Virtual Memory" ( Class Name column ) related to the app ( Module Name column ) raises constantly during the execution of the app.
May it be a problem related to program code or it is normal ?
I'm using the Allocation Profiler on AQTime v6.
Carlos
|
|
|
|
|
caoctaviano wrote: May it be a problem related to program code or it is normal ?
Could be - but I can think of scenarios where it's perfectly normal behaviour. I've never used AQTime, so I don't really feel qualified to comment...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I have a problem similar! What do you do to resolve?
Do you have any threads in your project ? Because in my project have some threads and data base connection with postgres.
Thanks!
|
|
|
|
|
Hey can anyone help me to plot the 3D graphs in C++ ??
Thanks in advance
suchitamanandhar@hotmail.com
|
|
|
|
|
SayamiSuchi wrote: Hey can anyone help me to plot the 3D graphs in C++ ??
Probably. What's your question?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
We all can't wait to help you...What's your doubt about?
BTW did you read forum guidelines [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You can try some third party tools or please check the Desktop Development section. you will get lots of help in that.
|
|
|
|
|
You don't need any third party components (never in Windows..)
Simply use the native Win32 Graph control
|
|
|
|
|
I have two specific keys available at the following location in registry
HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\INSTALLER\USERDATA\S-1-5-18\PRODUCTS\---CLASSID----\InstallProperties\
The above path is having classid with it.
How to read this and retrieve the value.
|
|
|
|
|
Venkat KR wrote: How to read this and retrieve the value.
Maybe you can use CRegKey[^]
|
|
|
|
|
Venkat KR wrote: How to read this and retrieve the value.
Start here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
//Open the registrey and check that is it writable
lRet=RegOpenKey(HKEY_LOCAL_MACHINE, strKeyPath,hKey);
//if lRet != ERROR_SUCCESS then go to read registrey
unsigned char* lpBufferValue = new unsigned char [dwSize];
unsigned long dwType = 0;
unsigned long dwSize = 0;
lpBufferValue = new unsigned char [dwSize];
ASSERT(lpBufferValue);
lRet = RegQueryValueEx(hKey,strValueName, NULL,dwType, lpBufferValue,dwSize);
// if dwSize is not 0 then it is success
// close registrey (either success or failure )
RegCloseKey(hKey);
I hope this will work.
It's not enough to be the best, when you have capability to be great..
|
|
|
|
|
//Open the registrey and check that is it writable
lRet=RegOpenKey(HKEY_LOCAL_MACHINE, strKeyPath,hKey);
//if lRet != ERROR_SUCCESS then go to read registrey
unsigned char* lpBufferValue = new unsigned char [dwSize];
unsigned long dwType = 0;
unsigned long dwSize = 0;
lpBufferValue = new unsigned char [dwSize];
ASSERT(lpBufferValue);
lRet = RegQueryValueEx(hKey,strValueName, NULL,dwType, lpBufferValue,dwSize);
// if dwSize is not 0 then it is success
// close registrey (either success or failure )
RegCloseKey(hKey);
I hope this will work.
It's not enough to be the best, when you have capability to be great....
|
|
|
|
|
I am creating an app where I have CListBox object. I call .AddString() to add 10 string to the list. After the list is initialized, I want to update some of the string data in the list. How to do ? I reviewed all the class member of CListBox and I do not see any type of update string method. The only way I see to do this type of operation is to use Add/Delete methods. There must be a bette way Please help, so much time wasted on this class.
|
|
|
|
|
Perhaps your requirements call for using a ListView rather than a ListBox?
|
|
|
|