Distributed Memory implementation

tcak via Digitalmars-d digitalmars-d at puremagic.com
Mon Jan 18 03:24:05 PST 2016


On Monday, 18 January 2016 at 09:56:17 UTC, Adrian Matoga wrote:
> On Monday, 18 January 2016 at 05:59:15 UTC, tcak wrote:
>> I, due to a need, will start implementation of distributed 
>> memory system.
>>
>> Idea is that:
>>
>> Let's say you have allocated 1 GiB space in memory. This 
>> memory is blocked into 4 KiB.
>>
>> After some reservation, and free operations, now only the 
>> blocks 0, 12, and 13 are free to be allocated.
>>
>> Problem is that those memory blocks are not consecutive.
>>
>> With the implementation of distributed memory, those blocks 
>> will be appended into a struct or object (however it is 
>> implemented), and that struct or object will allow access to 
>> that 12 KiB of space (3 x 4 KiB blocks) like it is allocated 
>> in memory consecutively.
>>
>> Is there anything like this in Phobos, or shall I start my own 
>> implementation?
>
> Just a note about terminology: I'd rather call it "fragmented 
> memory" or something alike. The term "distributed memory" 
> usually refers to something really different [1].
>
> Your idea seems interesting, but IMHO a compacting GC should be 
> the preferred solution for heap fragmentation.
>
> [1] https://en.wikipedia.org/wiki/Distributed_memory

I was trying to remember the Windows program that is about disk 
clusters "De...". Couldn't remember. It was Defragmentation. Yes, 
Fragmented Memory is much better. It is definitely not that 
distributed memory thing.

In my use case, a server program reserves a part of shared memory 
to client application, then when the client program is done with 
that memory, it releases them. So, making it dependent on GC 
might not be good. But I am sure, many use cases can be found 
that fits to GC.


More information about the Digitalmars-d mailing list