nghttp2_option_no_closed_streams controls whether closed streams are retained or not. If nonzero is passed to that function's parameter val, a session does not retain closed streams. It may hurt the shape of priority tree, but can save memory.