Questions tagged [heap-fragmentation]
32 questions
3
votes
2 answers
Best way to represent formatted text in memory? C++
I'm writing a basic text editor, well it's really an edit control box where I want to write code, numerical values and expressions for my main program.
The way I'm currently doing it is that I feed character strings into the edit control. In the…

Karl Hansson
- 227
- 1
- 2
- 9
3
votes
4 answers
How do I workaround heap fragmentation in a C++ server program?
Heap fragmentation can cause a server application that is expected to run continuously for many months to suddenly start malfunctioning thinking that it's out of memory.
Let's assume that I've done my best to minimize runtime heap fragmentation in…

sharptooth
- 167,383
- 100
- 513
- 979
2
votes
1 answer
System.Security.Policy.Evidence, Web Services and Blowing Out the LoH
A new application that has been developed has a heavy use of web services. We started hitting out of memory exceptions on a regular basis (as usage has increased). Upon reviewing the memory dumps I noticed there were a large number of same sized…

Dan
- 1,396
- 1
- 10
- 21
2
votes
2 answers
Force .NET GC to compact or defragment generation 2 heap?
We wrote a windows service by C# in .NET framework, after some hours we noticed that the size of heap generation 2 is growing unordinary.
Most of this space is free and dotMemory Profiler showed us that we have about 90% fragmentations on this…

Elnaz Yousefi
- 195
- 1
- 3
- 17
2
votes
4 answers
When to address managed heap fragmentation
I was reading a blog entry by Josh Smith where he used a cache mechanism in order to "reduce managed heap fragmentation". His caching reduces the number of short-lived objects being created at the cost of slightly slower execution speed.
How much of…

sourcenouveau
- 29,356
- 35
- 146
- 243
2
votes
1 answer
Linux Heap Fragmentation
I have a question that keeps bothering me for the last week.
In Windows debugger there is the !heap -s command that outputs the virtual memory's heap status and calculates the external fragmentation using the formula :
External fragmentation = 1 -…

dimitrios
- 43
- 1
- 5
1
vote
1 answer
Fragmentation on .NET LOH due to pinned objects
I'm troubleshooting an application written in .net 4.5 Asp.net + Unity 3.0.1304.1 + Nhibernate 3.3.1.4 that reaches 3 to 5 GB of memory consumption, which is above the expected.
After collecting some Memory Dumps it became clear there was…

IgorMrcl
- 19
- 3
1
vote
1 answer
garbage collection for specific circumstances
I'm working with just the basics of garbage collection and the different algorithms of each (plus pro's con's etc..). I'm trying to determine that best garbage collection algorithm to use for different scenarios.
such as: everything on heap same…

DJPlayer
- 3,244
- 2
- 33
- 40
1
vote
4 answers
Is it better to use a vector containing pointers, or a vector of values (to avoid heap fragmentation)?
I'm aware of the many articles on avoiding heap fragmentation. My question has to do with specifically what happens when we use a vector to store data:
class foo{
public:
std::vector; // Or I can have std::vector
};
I have no problem…

Rahul Iyer
- 19,924
- 21
- 96
- 190
0
votes
2 answers
C++ placement new alignment of classes (on a SAMD21 microcontroller)
I am working on an application which is running on a SAMD21 microcontroller. For those unfamiliar with the SAMD21, it contains an ARM Cortex-M0+ processor. The specific model I am using has 32 kB of RAM. My application is running up to the limits of…

David
- 1,847
- 4
- 26
- 35
0
votes
1 answer
Frequent, highly fragmented index on heap table
I have a table (a heap table) with a nonclustered index that frequently becomes highly fragmented. The data in column ID comes from (is imported from) data from a csv file and the ID is thereafter used in other table relations for reporting…
0
votes
2 answers
Fighting fragmentation in custom memory manager
I've written a c/c++ memory manager for heap allocations (overloaded new/delete and malloc/realloc/free, based on Doug Lea's malloc but designed to be wait free) and seem to be having some trouble with fragmentation. Are there any good resources out…

Grant Peters
- 7,691
- 3
- 45
- 57
0
votes
0 answers
Does log4cpp takes care of heap fragmentations issue?
I develop on windows 64bit with VS2015.
I used a custom logger but it suffered from heap fragmentations.
I found log4cpp library. According to the source code it uses std::ostringstream internally.
My questions:
I think my main question is can I…

theateist
- 13,879
- 17
- 69
- 109
0
votes
0 answers
Windows 10 memory fragmentation on long application run
We are facing a memory fragmentation issue in our 32 bit app (C++ and WPF based). when we run it for 100 hrs. as part of automated test. Application crashes after running AST for ~14 hrs.
We use CRT heap with LFH policy (Low fragment Heap) …

Nikhil
- 9
- 3
0
votes
1 answer
Best STL containers to avoid heap fragmentation
I have a program which analyzes 150,000 files. Valgrind reports no memory leak but the program slows over time.
Some of the problems were related to using std::string too often and mktime taking too much time. (see C++ slows over time reading…

Danny
- 2,482
- 3
- 34
- 48