I wrote a large code, but it spends memory very quick. Is there any
method to supervise memory's use and watch whether there is some waste? 4 1357
I forget to say that I always use new and delete to create and delete
some matrix
In windows,system tool can helps.
In unix, some Solaris has a a number of tools.
Firstly, "pmap" gives you a nice breakdown of the process' memory usage.
If you're on x86 you can probably compile Valgrind for solaris: that's
pretty much the golden standard. If you're on Sparc then I suggest the
open source Dmalloc library. Electric fence is an oldie but a goodie,
and it's had leak detection bolted on.
Above anwser from Jacques.
<ya**********@g mail.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.com.. . I wrote a large code, but it spends memory very quick. Is there any method to supervise memory's use and watch whether there is some waste? ya**********@gm ail.com wrote: I wrote a large code, but it spends memory very quick. Is there any method to supervise memory's use and watch whether there is some waste?
It's much easier to not use 'new' and 'delete' than to find where the
leaks come from. Try using vector, it takes care of memory for you.
Hope this helps,
-shez- This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Guy |
last post by:
Hi
It might take me a little time to explain this but here goes.
Firstly I'm not using the latest upto date python releases so my first
plan is to try more upto date rels of python and win32 libs, as this
has fixed problems for me in the past (Don't like doing this as it
usally breaks stuff and sys admin are slow to update software,
although they do a cracking job, just covering my back.)
I've created a build script for my companies...
|
by: Bryan Parkoff |
last post by:
I work emulator project using 32 Bit emulated processor. The problem is
that it attempts to allocate 4GB memory because some people want to use
emulated instruction to read data from 4GB memory. It is always not
necessary because it can waste a lot of memory.
There is a way to create pointer list. Emulator project can only
allocate less than 1GB memory that it is always enough. One GB memory is a
real memory. Then, it can allocate...
|
by: jacob navia |
last post by:
In C, we have read-only memory (const), read/write memory
(normal data), and write only memory.
Let's look at the third one in more detail.
Write only memory is a piece of RAM that can only
be written to, since its contents are undefined.
The program is allocating a new piece of data, and
the previous contents aren't relevant. This memory
|
by: anguish |
last post by:
I'm using ReadProcessMemory from kernel32.dll to read specific bytes
from the process memory of a program. While the solution I have now
(which updates the memory content at regular intervals) works, I can
help thinking that it's a waste of resources. It also possible to miss
changes if the interval is set too long.
I'm a newbie when it comes to eventhandlers, and I guess I could
benefit from learning-by-doing on somewhat less complex...
|
by: ballpointpenthief |
last post by:
If I have malloc()'ed a pointer and want to read from it as if it were
an array, I need to know that I won't be reading past the last index.
If this is a pointer to a pointer, a common technique seems to be
setting a NULL pointer to the end of the list, and here we know that
the allocated memory has been exhausted. All good.
When this is a pointer to another type, say int, I could have a
variable that records how much memory is being...
| |
by: Divick |
last post by:
Hi,
can somebody help me figure out how can I make write a function
which inturn uses malloc routine to allocate memory which is 2^k
aligned?
The condition is such that there should not be any memory leak and it
should not also waste memory.
Thanks,
Divick
|
by: zzw8206262001 |
last post by:
Hi,I find a way to make javescript more like c++ or pyhon
There is the sample code:
function Father(self) //every contructor may have "self"
argument
{
self=self?self:this; //every class may have this statement
self.hello = function()
{
|
by: John Machin |
last post by:
I have stumbled across some class definitions which include all/most
method names in a __slots__ "declaration". A cut-down and disguised
example appears at the end of this posting.
Never mind the __private_variables and the getter/setter approach, look
at the list of methods in the __slots__.
I note that all methods in an instance of a slotted class are read-only
irrespective of whether their names are included in __slots__ or not:...
|
by: Curious |
last post by:
Hi,
I have a timer object that's launched as below:
mTimer = new System.Threading.Timer (new
TimerCallBack(SubscribeTrade), null, 15000, 15000);
void SubscribeTrade (object state)
{
DateTime now = DateTime.Now;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |