Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

region_reset() leaks memory #12

Open
kostja opened this issue Nov 17, 2016 · 0 comments
Open

region_reset() leaks memory #12

kostja opened this issue Nov 17, 2016 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@kostja
Copy link
Contributor

kostja commented Nov 17, 2016

region_reset() only marks the first block as free. There may be other blocks which are neither reset no returned to the slab cache. Better free all blocks except the first - that would be both fast for small amounts and safe for big ones.

@kostja kostja added the bug Something isn't working label Nov 17, 2016
GeorgyKirichenko pushed a commit that referenced this issue Jan 27, 2020
Do not allocate a new slab if there is a free slab in a region cache.
If a cached slab is not big enough then free it.

Follow up 67d7ab4

Fixes #12
Totktonada added a commit that referenced this issue Jan 29, 2020
This reverts commit 67d7ab4.

The goal of the reverted commit was to fix flaky fails of tarantool
tests that checks amount of memory used by a fiber:

 | fiber.info()[fiber.self().id()].memory.used

It also attempts to overcome the situation when a fiber holds some
amount of memory, which is not used in any way. The high limit of such
memory is controlled by a threshold in fiber_gc() tarantool's function
(128 KiB at the moment):

 | void
 | fiber_gc(void)
 | {
 |         if (region_used(&fiber()->gc) < 128 * 1024) {
 |                 region_reset(&fiber()->gc);
 |                 return;
 |         }
 |
 |         region_free(&fiber()->gc);
 | }

The reverted commit, however, leads to significant performance
degradation on certain workloads (see #4736). So the revertion fixes the
performance degradation and opens the problem with tests, which is
tracked in #4750.

Related to #12
Related to tarantool/tarantool#4750
Fixes tarantool/tarantool#4736
kyukhin pushed a commit that referenced this issue Jan 29, 2020
This reverts commit 67d7ab4.

The goal of the reverted commit was to fix flaky fails of tarantool
tests that checks amount of memory used by a fiber:

 | fiber.info()[fiber.self().id()].memory.used

It also attempts to overcome the situation when a fiber holds some
amount of memory, which is not used in any way. The high limit of such
memory is controlled by a threshold in fiber_gc() tarantool's function
(128 KiB at the moment):

 | void
 | fiber_gc(void)
 | {
 |         if (region_used(&fiber()->gc) < 128 * 1024) {
 |                 region_reset(&fiber()->gc);
 |                 return;
 |         }
 |
 |         region_free(&fiber()->gc);
 | }

The reverted commit, however, leads to significant performance
degradation on certain workloads (see #4736). So the revertion fixes the
performance degradation and opens the problem with tests, which is
tracked in #4750.

Related to #12
Related to tarantool/tarantool#4750
Fixes tarantool/tarantool#4736
kyukhin pushed a commit that referenced this issue Jan 29, 2020
This reverts commit 67d7ab4.

The goal of the reverted commit was to fix flaky fails of tarantool
tests that checks amount of memory used by a fiber:

 | fiber.info()[fiber.self().id()].memory.used

It also attempts to overcome the situation when a fiber holds some
amount of memory, which is not used in any way. The high limit of such
memory is controlled by a threshold in fiber_gc() tarantool's function
(128 KiB at the moment):

 | void
 | fiber_gc(void)
 | {
 |         if (region_used(&fiber()->gc) < 128 * 1024) {
 |                 region_reset(&fiber()->gc);
 |                 return;
 |         }
 |
 |         region_free(&fiber()->gc);
 | }

The reverted commit, however, leads to significant performance
degradation on certain workloads (see #4736). So the revertion fixes the
performance degradation and opens the problem with tests, which is
tracked in #4750.

Related to #12
Related to tarantool/tarantool#4750
Fixes tarantool/tarantool#4736
@kyukhin kyukhin added this to the wishlist milestone Oct 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants