Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

add Internals::gc() #336

Open
Open
@rurban

Description

@rurban

Scan the arenas and free empty ones.

The heads (PL_arenaroot), the bodies (PL_body_arenas and the PL_body_roots[type] free-list),
The opslab's (CvSTART of all CVs) and ops are correctly freed via cv_undef, see -DS.
Check on del_SV if an arena is free, and free its memory then.
Add a malloc_trim(0) call to actually force free() to return memory pages to return to the OS, so that the rss is improved. glibc only.

Furthermore check the implementation of the free-list (body_roots), which seems to support only one (just a ptr, not a linked list as the adesc->arena or HE chain), and check for a free arena on del_SV.
Similarily the obslab impl. also has an OP overhead of 2 ptrs (next and slab owner), whilst it could be easier implemented as sized arenas as with the body roots.
The SV arenas should really be simplified to allocate into one sized arena slot, (no seperation of head and body) but this would make upgrades with references harder, and we don't have small forwards.

For now see feature/gh336-gc, destruction became unstable with it.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions