ACE_TAO icon indicating copy to clipboard operation
ACE_TAO copied to clipboard

Cascaded Multi Size Based Allocators Achiving the 'infinite' space ability as ACE_Malloc

Open smithAchang opened this issue 1 year ago • 8 comments

ACE_Malloc memory pool has only one linked list,

so when it has a very long list and has various, random chunk size distribution, the cost of its memory management is great.

In our case, the free API of ACE_Malloc has consumed much CPU time.

So I use the ACE_Cascaded_Dynamic_Cached_Allocator class provided in my previous PR to form a allocator hierarchy with various fixed-size achieving the 'infinite' space ability as ACE_Malloc by a cost of O(1).


Main Design

  • Use size-based allocator to reduce the cost of malloc/free

  • Decrease ACE_Cascaded_Dynamic_Cached_Allocator's initial_n_chunks constructor parameter according to the hierarchy level, but can be adjusted by a threshold min_initial_n_chunks parameter

  • Increase ACE_Cascaded_Dynamic_Cached_Allocator's chunk_size constructor parameter according to the hierarchy level, it will enable bigger chunks can be malloced

smithAchang avatar Sep 23 '23 15:09 smithAchang

Converted to draft as this looks to be in development

jwillemsen avatar Sep 26 '23 13:09 jwillemsen

For some security reason, the codes has some misspell.

The test case is enriched becuase the bug produced by misspell , Including Cascaded Allocator PR.

The work has completed after yesterday, it can be considered to merge into main repo :)

smithAchang avatar Sep 27 '23 01:09 smithAchang

Please remove the MPC submodule

jwillemsen avatar Sep 27 '23 06:09 jwillemsen

Please remove the MPC submodule

ok , it's my misoperation

:)

smithAchang avatar Sep 27 '23 11:09 smithAchang

So I use the ACE_Cascaded_Dynamic_Cached_Allocator class provided in my previous PR to form a allocator hierarchy with various fixed-size achiving the 'infinite' space ability as ACE_Malloc by a cost of O(1).

Which PR is that? Please add a link.

mitza-oci avatar Sep 28 '23 19:09 mitza-oci

[...] with various fixed-size achieving the 'infinite' space ability as ACE_Malloc by a cost of O(1).

Please explain what the phrase "'infinite' space ability" means.

mitza-oci avatar Sep 28 '23 19:09 mitza-oci

So I use the ACE_Cascaded_Dynamic_Cached_Allocator class provided in my previous PR to form a allocator hierarchy with various fixed-size achiving the 'infinite' space ability as ACE_Malloc by a cost of O(1).

Which PR is that? Please add a link.

Cascaded allocator

smithAchang avatar Sep 29 '23 00:09 smithAchang

[...] with various fixed-size achieving the 'infinite' space ability as ACE_Malloc by a cost of O(1).

Please explain what the phrase "'infinite' space ability" means.

This allocator can assign memory as ACE_Malloc , can assign various size chunks and assign as many bytes as the OS can permit

smithAchang avatar Sep 29 '23 00:09 smithAchang