With the development of semiconductor technology, more modules are integrated onto a single chip. Multiprocessor system-on-chip (MPSoC) is such circuit with multiple embedded processor cores on chip. It provides high parallelism with multithreads through the multiple cores. Memory system is still the bottleneck of the performance and power-consumption of MPSoC systems. Scratchpad memory (SPM), which is softwarecontrolled on-chip memory without extra tags, is used on MPSoC chips. SPM has low power-consumption and high efficiency compared to cache. However, the SPM requirements from different cores will be also different. How to balance the utilization of SPM is still a challenge. In this paper, we propose a new technique for SPM allocation on demand to reduce the power consumption and improve the performance of MPSoC. SPM will be shared under special constrains. Experimental results show that our approach can reduce both the execution time and the energy consumption effectively.