reduce memory usage while parsing multiple keyrings from a stream