Questions tagged [memory-fragmentation]

86 questions
19
votes
5 answers

Which memory allocation algorithm suits best for performance and time critical c++ applications?

I ask this question to determine which memory allocation algorithm gives better results with performance critical applications, like game engines, or embedded applications. Results are actually depends percentage of memory fragmented and…
baris.aydinoz
  • 1,902
  • 2
  • 18
  • 28
17
votes
2 answers

Memory fragmentation

When I use malloc()s and free()s randomly, nested and with different sizes, at some point the memory will be fragmented because these operations leave a large list of small memory areas behind that are non-contiguous and therefore can't be allocated…
Elmi
  • 5,899
  • 15
  • 72
  • 143
16
votes
3 answers

Heap fragmentation when using byte arrays

I have a C# 4.0 application (single producer/single consumer) which transfers huge amount of data in chunks. Although there's no new memory allocation I run out of memory after a while. I profiled memory using Redgate memory profiler and there are a…
Xaqron
  • 29,931
  • 42
  • 140
  • 205
15
votes
1 answer

Understanding internal fragmentation properties of Hotspot JVM process

For both on-heap and off-heap allocations. On-heap - in the context of three major garbage collectors: CMS, Parallel Old and and G1. What I know (or think that I know) to the moment: all object (on-heap) allocations are rounded up to 8 bytes…
11
votes
2 answers

Why is memory fragmentation an issue on a 64-bit machine?

In a 32-bit machine each process gets a 4GB virtual space. In this case one can worry that we might face trouble due to fragmentation. But in the case of a 64-bit machine we theoretically have a huge addressable virtual memory, so why is memory…
Raghupathy
  • 823
  • 1
  • 9
  • 21
11
votes
5 answers

Can "pragma pack 1" be helpful to avoid heap fragmentation?

In my program I see some resident size increase. I suppose it is because of heap fragmentation. So I am planning to use #pragma pack 1. Will it reduce the heap fragmentation? Will it be having some other overheads? Shall I go for it or not?
piyush
  • 868
  • 13
  • 29
10
votes
2 answers

"Memory Fragmentation" is it still an issue?

I'm a little bit confused. In the OS course we were told that all OSes take care of memory fragmentation by paging or segmentation and there is no contiguous physical memory allocation at all. OS uses different levels of addressing…
Afshin
  • 392
  • 2
  • 11
9
votes
1 answer

strange slowing down of C++ allocs

Could someone please tell me why following things could happen: I have 2 computers: my working comp Server I maintain C++ program (msvc 2005 c++ compiled) that works too slow only on server, but not on my comp. I conducted measurements…
9
votes
6 answers

Thinking of memory fragmentation while you code: Premature Optimization or not?

I'm working on a large server application written using C++. This server needs to run possibly for months without restarting. Fragmentation is already a suspected issue here, since our memory consumption increases over time. So far the measurement…
void.pointer
  • 24,859
  • 31
  • 132
  • 243
8
votes
3 answers

strategy to allocate/free lots of small objects

I am toying with certain caching algorithm, which is challenging somewhat. Basically, it needs to allocate lots of small objects (double arrays, 1 to 256 elements), with objects accessible through mapped value, map[key] = array. time to initialized…
Anycorn
  • 50,217
  • 42
  • 167
  • 261
7
votes
1 answer

How to Solve Gen2 Heap Fragmentation

I am running a C# application that services HTTP requests. I have noticed recently that it's taking up more memory then I expect. I grabbed some dumps, popped them in Windbg, and found that most of the memory was marked as Free: !dumpheap…
7
votes
1 answer

.NET application memory usage - high unused .NET and unmanaged memory and fragmentation

I am using ANTS memory profiler to diagnose an increase in memory leak I am facing in one of my .NET 2.0 applications. I took 7 snapshots of the process over a period of 7.5 hours, and here is a tabular representation of the data obtained - G1…
Cygnus
  • 3,222
  • 9
  • 35
  • 65
6
votes
3 answers

Detecting memory fragmentation problem in a process

What are the various mechanisms using which we can detect if a process execution is leading to memory fragmentation? Are there any tools available for the same? Suggestion for tools which work with 'C' code and can run on Windows, Linux and VxWorks…
Jay
  • 24,173
  • 25
  • 93
  • 141
6
votes
1 answer

Much memory fragmentation with System.Threading.OverlappedData (async await)

I'm constantly running slowly out of memory. I've used WinDbg to have a look at the memory dump and this it what it looks like: 000007f975ee0630 557377 41027736 System.Object[] 000007f975f004d0 18781 47746604…
user1275154
  • 1,120
  • 1
  • 12
  • 24
6
votes
1 answer

Is it possible to solve CUDA memory fragmentation issue?

I'm trying to allocate some memory but sometimes get error "out of memory". cudaMemGetInfo says that available more memory that I need. So, problem in memory fragmentation. Is it possible to fix this problem? Is it possible to place elements in…
Robotex
  • 1,064
  • 6
  • 17
  • 41
1
2 3 4 5 6