From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 22 May 2018 17:00:20 +0300 From: Konstantin Osipov Subject: Re: [PATCH 8/8] memtx: run garbage collection on demand Message-ID: <20180522140020.GH11201@atlas> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: To: Vladimir Davydov Cc: tarantool-patches@freelists.org List-ID: * Vladimir Davydov [18/05/22 15:10]: > When a memtx space is dropped or truncated, we delegate freeing tuples > stored in it to a background fiber so as not to block the caller (and tx > thread) for too long. Turns out it doesn't work out well for ephemeral > spaces, which share the destruction code with normal spaces: the problem > is the user might issue a lot of complex SQL SELECT statements that > create a lot of ephemeral spaces and do not yield and hence don't give > the garbage collection fiber a chance to clean up. There's a test that > emulates this, 2.0:test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua. > For this test to pass, let's run garbage collection procedure on demand, > i.e. when any of memtx allocation functions fails to allocate memory. The patch looks good to me, except the signature of run_gc, which should be changed from the previous patch.. We're getting really close for capped collections with this patch, but a log structured allocator would fit in really nicely before that. -- Konstantin Osipov, Moscow, Russia, +7 903 626 22 32 http://tarantool.io - www.twitter.com/kostja_osipov