[tarantool-patches] [PATCH v2] txn: factor fiber_gc out of txn_rollback

Vladimir Davydov vdavydov.dev at gmail.com
Mon Mar 11 15:27:38 MSK 2019


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.



More information about the Tarantool-patches mailing list