Reduce memory usage in doublekl