95 questions
2
votes
1
answer
116
views
oneAPI TBB fixed_pool malloc() function keeps failing
SUMMARY
I've been trying to use the fixed_pool feature in my project, but the malloc() function keeps failing, returning nullptr.
I also tried to run the sample code in the docs : https://www.intel....
0
votes
0
answers
85
views
Why MemoryPool is slower when allocate small size data in C++
I wrote the MemoryPool test code as below, and the MemoryPool allocates memory faster only when the fieldSize is set to 10000 or more. Why is it slower when allocating memory with smaller sizes?
#...
0
votes
0
answers
50
views
why do i use the correct lock free algorithm but still encount concurrent problems in a lock-free list?
I write a fixed size memory pool(deault size is page size) and a microbenchmark for performance testing.
There are two problems:
A double free problem in memory pool destruction function.
when ...
1
vote
1
answer
620
views
memory pool in thrust execution policy
I am looking for solutions to use a memory pool within thrust as I want to limit the number of calls to cudaMalloc.
device_vector definitely accepts an allocator, but it's not so easy to deal with ...
0
votes
1
answer
301
views
Ada: named access types and memory pools
I have read the following from wikibooks:
A pool access type handles accesses to objects which were created on some specific heap (or storage pool as it is called in Ada). A pointer of these types ...
0
votes
1
answer
315
views
C++ use of std::atomic<A> for accessing a memory pool
An object has a memory pool assigned to it by malloc().
This object accesses the memory pool for reading and writing using std::atomic<A> *.
<A> could be a class which is trivially ...
2
votes
0
answers
901
views
Pool for std::shared_ptr memory
My goal is to have std::shared_ptr allocate ALL of its memory using a pool rather than the global memory resource (i.e., heap).
From what I can tell, might possible using constructor (6) from https://...
1
vote
1
answer
659
views
Convert string to IMemoryOwner / Copy string into a rented buffer
I have a custom memory sequence OwnedMemorySequence. I want to put a string inside. The issue is that I cannot get it to compile. Usually something like Encoding.UTF8.GetBytes and then copy that ...
1
vote
1
answer
78
views
Setting the `min_alloc_size` for the constructor for `boost::pool<>` encounter segment fault whereas it works well without the said parameter?
Why this code snippet encounter segment fault when setting the min_alloc_size for the constructor for boost::pool<> whereas it works well without setting the said parameter?
Here is the code ...
1
vote
1
answer
1k
views
Fix memory consumption of a go program with goroutines
I am working on a problem that involves a producer-consumer pattern. I have one producer who produces the task and 'n' consumers that consumes the task. A consumer task is to read some data from a ...
0
votes
1
answer
524
views
Allocating byte arrays of memory from fixed memory block
How can I use boost pool or some other similar allocator technique to allocate contiguous 512 byte sectors from a fixed block of memory. I am trying to emulate a memory filesystem in C++17.
I assume ...
1
vote
0
answers
121
views
Is there a c/c++ lib provide memory pool implementation has stdlib-like interfaces?
I have an idea to create a manually managed continuously block of memory by c/c++ codes, and provides something like:
typef struct managedVM
{
void* pBuffer;
int length;
}managedVM;
typedef ...
13
votes
4
answers
5k
views
If memory pools are faster than malloc, why doesn't malloc use them under the covers?
I keep hearing that memory pools can signficantly improve performance when allocating memory.. so why aren't they used in some way by traditional malloc implementations?
I know part of it is that ...
1
vote
1
answer
978
views
How to properly use memory pools C++11-style?
I'm trying to design the internal mechanics of a simple embedded application. Chunks of data arrive on the network which need to be delivered to components determined by an addressing mechanism. ...
0
votes
2
answers
561
views
What is the Maximum size Malloc function return at run-time? [closed]
Question 1: what is the Maximum memory MALLOC can allocate?
Question 2: Does Malloc allocate all the memory user had requested or just SUBSTANTIAL amount of memory.
I've tried to find the ...
0
votes
1
answer
93
views
Initializing class/struct from a void pointer [duplicate]
I have a memory pool that is allocated as char*. When I want to create an object I request memory from that pool that returns a char* somewhere in that pool cast to a void*.
So when I create a object ...
1
vote
1
answer
1k
views
Allocator that manages a single block of memory
Due to system limitations, suppose that I can only allocate memory from a heap once (for example with std::allocator or some other more general C++11 compliant allocator).
This single allocation will ...
1
vote
1
answer
90
views
Deterministic compile time mapping function for MemoryPool
please refer to the picture below where I tried to show what I am trying to implement:
There are several memory Partitions statically allocated in the memory containing chunks of various sizes, known ...
1
vote
2
answers
1k
views
C++ Boost binary serialization of pointer constructed from Boost object_pool
My application has a class "MyClass". It's objects are being constructed from the Boost Object_pool.
I need to serialized/de serialize this class object via Boost Binary Serialization.
For ...
7
votes
3
answers
7k
views
Understanding Memory Pools
To my understanding, a memory pool is a block, or multiple blocks of memory allocate on the stack before runtime.
By contrast, to my understanding, dynamic memory is requested from the operating ...
0
votes
3
answers
407
views
Akka actor message needs memory pool
I a new in java. I'm c++ programmer and nowadays study java for 2 months.
Sorry for my pool English.
I have a question that if it needs memory pool or object pool for Akka actor model. I think if i ...
1
vote
0
answers
173
views
How to integrate Memory Pool concept into data structure (e.g. custom array)?
I have been using component-entity system.
Long time ago, I wanted to improve it to use memory pool.
Phase 1
For simplicity, here is my ancient code :-
Entity* entity =new Entity(); ...
0
votes
1
answer
124
views
How do I create a proper Memory Poolfor a Multithreaded vector (LFSV)?
Below is an old exercise for a class that is no longer being taught at my university (Parallel Processing). The goal is to create and use a Memory Bank to speed up the Lock-Free Sorted Vector ...
3
votes
0
answers
80
views
Could STL containers be used without being destroyed if the allocator's deallocate() is noop?
Sorry for the long title~
I have a simple allocator implemented on top of a memory pool whose deallocate() is empty. If a STL container is used with this allocator and the elements of the container ...
0
votes
1
answer
904
views
Initial block size for memory pool
I am implementing a memory pool class using C++ template, and I am wondering what a good size could be for the block. For example:
template <typename T>
class Mempool {
unsigned char* block;
...