473,403 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

Memory fragmentation

Recently I ask here about custom new and delete.
There some people stated, that memory fragemtation
might be avoided by this.
Just to get this clear:
As long as I have enough physical memory installed,
fragementation does not matter at all for the performance, does it?
Some memory might be wasted, but does this matter for the
performance in any way? (on a typical implementation on
a x86 workstation (gcc, vc, ...))

Thanks

Aug 29 '07 #1
2 1552
On 29 Aug., 12:27, cppques...@googlemail.com wrote:
Recently I ask here about custom new and delete.
There some people stated, that memory fragemtation
might be avoided by this.
Just to get this clear:
As long as I have enough physical memory installed,
fragementation does not matter at all for the performance, does it?
Some memory might be wasted, but does this matter for the
performance in any way? (on a typical implementation on
a x86 workstation (gcc, vc, ...))

Thanks
People tend to think that it is okay to write sloppy code due to today
immense precessing power, amount of memory, etc. but they also forget
that it is not only this one little program that has to run on the
system, it all has to work together, and no matter what it will all
result i problems eventually, one way or another.
Often it doesn't take much to ensure that the code is good. A little
bit of planing and stuff will do the trick.

Aug 29 '07 #2
On 2007-08-29 12:27, cp********@googlemail.com wrote:
Recently I ask here about custom new and delete.
There some people stated, that memory fragemtation
might be avoided by this.
Just to get this clear:
As long as I have enough physical memory installed,
fragementation does not matter at all for the performance, does it?
Some memory might be wasted, but does this matter for the
performance in any way? (on a typical implementation on
a x86 workstation (gcc, vc, ...))
The following is totally off topic for this group since it deals with
the hardware.

If the data needed by the program is located all over the place it can
have negative impact on the performance due to caching. There are two
problems, the first is that the CPU works by the principle of locality
of reference, meaning that a program usually tends to work on data with
addresses close to each other. This means that the CPU can speculate on
what address you'll be accessing next and load them at the same time. IF
this fails it means that 1) it has spent time to load data into cache
that you don't need, and 2) that it has to load some other data into the
cache.

A second problem is that two non-contiguous addresses can map to the
same cache-line, which means that the CPU might have to pull some data
back and forth between cache and RAM while working. This is probably not
as common since the CPU guys have some cleaver techniques to prevent
this from happening.

If you want to be a good programmer you really need at least a basic
understanding of how the hardware works, Patterson and Hennessy have
written good books on the topic.

--
Erik Wikström
Aug 29 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: cody | last post by:
i basically want to create an object which contains an array (the last element of the class). the size of the array is determined when the object is created. for performance reasons (avoiding...
8
by: Tron Thomas | last post by:
As part of applying for a programming position at a company, I recently I had submitted some code samples to one of the developers for review. This is the feedback I received: One of his...
18
by: Tron Thomas | last post by:
Given the following information about memory management in C++: ----- The c-runtime dynamic memory manager (and most other commercial memory managers) has issues with fragmentation similar to a...
5
by: DLPnet | last post by:
Hello, I m working on Windows and Mac in C++. My application uses a lot of memory since it s dealing with a lot of images. So I load images in a cache when needed and if I haven t enough...
13
by: Rob Corwin | last post by:
Hi, a c# app of mine that parses 30,000 xml files writes large amounts of data to file (> 2GB) using a streamwriter object (sw). everything works fine except that the memory used by the app grows...
3
by: Florin | last post by:
Hi all, I have a problem related to memory grow on a server application which is basically stateless (I have some static info loaded). The client accesses this server using remoting and it has...
9
by: jeungster | last post by:
Hello, I'm trying to track down a memory issue with a C++ application that I'm working on: In a nutshell, the resident memory usage of my program continues to grow as the program runs. It...
5
by: vishnu | last post by:
Hi there, I am embedding python 2.5 on embedded system running on RTOS where I had strict memory constraints. As python is a huge malloc intensive application, I observed huge memory...
5
by: Andreas Schmitt | last post by:
Hi, I recently worked on an open source project and tried to make on of the arrays they are using dynamically allocated to get rid of the max size. I used the realloc instead of the usual C++...
8
by: jacek.dziedzic | last post by:
Hi! I need to be able to track memory usage in a medium-sized application I'm developing. The only significant (memory-wise) non- local objects are of two types -- std::vector<and of a custom...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.