With the number and variety of IoT devices increasing, a large amount of data have to be moved to the cloud, resulting into unpredictable latency from limitation of network bandwidth. R language, the most popular analytic tool, has a serious bottleneck, memory garbage collection, which will become even worse problem at the edge systems with limited memory resources. Processing a large amount of dynamic objects and high percentage of LLC misses with significantmiss penalty are the two key issues in the R execution environment. In this paper, we propose a Partially Parallel Garbage Collection to improve the waiting time during garbage collection; and a centralized memory allocation mechanism to reduce miss penalty that is caused by the high percentage of LLC misses. Our optimizations can bring benefits to those machine learning algorithms that spend most of time in R for processing large data list at the edge systems.