fix Spark memory leak (#1157)
Merge branch 'devel' into linker