Memory leaks in JAVA is a great influence on the stability.It cause memory leaks when the memory running program needs is greater than the maximum available of JVM.Scheme was proposed that to prevent memory leaks because of XML file is too large in JAVA by file splitting and assembling.The results of testing show memory leaks can be effective in preventing.