Questions tagged [memory-fragmentation]

81 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,834
  • 2
  • 17
  • 27
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
  • 26,135
  • 39
  • 130
  • 194
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…
12
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,261
  • 12
  • 57
  • 123
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
  • 718
  • 11
  • 26
9
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
  • 705
  • 1
  • 7
  • 18
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
  • 21,280
  • 21
  • 106
  • 196
8
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
  • 272
  • 2
  • 9
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
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
  • 46,748
  • 41
  • 153
  • 250
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
  • 22,129
  • 23
  • 82
  • 131
6
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,040
  • 8
  • 33
  • 59
5
votes
1 answer

Does memory fragmentation slows down New/Malloc?

Short background: I'm developing a system that should run for months and using dynamic allocations. The question: I've heard that memory fragmentation slows down new and malloc operators because they need to "find" a place in one of the "holes"…
OopsUser
  • 4,258
  • 6
  • 37
  • 59
5
votes
2 answers

Is it more efficient to once build a large string and pass it to response.write or call response.write for each piece

We've been running into daily OutOfMemoryExceptions in our ASP.Net 4.0 website. We suspect one of the problems is LOH fragmentation so we've been looking into code changes that would allocate memory more efficiently. For example, we're generating a…
1
2 3 4 5 6