One of the major challenges in the current prospect of big data is the inability to process a large volume of data at an acceptable time. Hadoop and Spark are two framework for distributed data processing. Hadoop is a very popular and general framework for big data processing. Spark is also as an open source framework for in-memory programming model to process return algorithms. In this paper, Hadoop and spark data processing framework have been evaluated and compared in terms of runtime, memory usage, Central Processing Unit (CPU), and network utilization. Thus, K-Nearest Neighbors (k-NN) Common Machine Learning Algorithm was implemented on data collection with various sizes and run on Hadoop and Spark framework. The obtained results show 2 to 4 times superiority of Spark compared to Hadoop within the implementation of the program. Evaluations show that Hadoop use sources including central processor and network more. On the other hand, memory usage is more in spark than that in Hadoop.