Ticket #1737 (closed patch: fixed)
Timing of GC runs
Reported by: | nwellnhof | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | GC | Version: | 2.6.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | Platform: |
Description
Currently, a GC run is triggered after 1MB of headers newly allocated (GC_SIZE_THRESHOLD). Similarly for buffers. This causes memory allocation to get slower the more memory a process consumes. Attached is patch that sets this threshold dynamically to half of the memory currently used, so the amortized cost of memory allocations stays roughly constant.
On my machine, a test script creating a hash with a million strings now completes in 1.0 seconds instead of 2.7 before. Inserting two million strings takes 2.0 seconds instead of 8.7.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.