Possibe fix to Scala memory leak, still some test is in progress