splash: refactor code
splash: refactor code
splash: use FreeOSMemory() to fix memory usage issue