[tarantool-patches] Re: [PATCH v2] txn: factor fiber_gc out of txn_rollback
Konstantin Osipov
kostja at tarantool.org
Mon Mar 11 17:21:49 MSK 2019
* Vladimir Davydov <vdavydov.dev at gmail.com> [19/03/11 15:31]:
Maybe we find a way to drop this patch altogether?
> On Mon, Mar 11, 2019 at 02:56:31PM +0300, Georgy Kirichenko wrote:
> > diff --git a/src/box/txn.c b/src/box/txn.c
> > index 7900fb3ab..1f488bbcc 100644
> > --- a/src/box/txn.c
> > +++ b/src/box/txn.c
> > @@ -399,8 +399,6 @@ txn_rollback()
> > txn_stmt_unref_tuples(stmt);
> >
> > TRASH(txn);
> > - /** Free volatile txn memory. */
> > - fiber_gc();
> > fiber_set_txn(fiber(), NULL);
> > }
> >
> > @@ -480,6 +478,8 @@ box_txn_rollback()
> > return -1;
> > }
> > txn_rollback(); /* doesn't throw */
> > + /** Free volatile txn memory. */
> > + fiber_gc();
> > return 0;
> > }
>
> Run this
>
> tarantool> for i = 1, 1000000 do pcall(box.space._schema.insert, box.space._schema, {'max_id'}) end
>
> and see RSS grow.
>
> I think you should also free memory on txn_rollback_stmt.
--
Konstantin Osipov, Moscow, Russia, +7 903 626 22 32
http://tarantool.io - www.twitter.com/kostja_osipov
More information about the Tarantool-patches
mailing list