Function-as-a-Service (FaaS), as a cloud computing service, builds, runs, and manages application packages directly in a functional way, greatly improving development and delivery efficiency, and is a major trend in the future development of cloud services. However, FaaS is executed via event-driven execution and has a cold-start problem at runtime. Most of the existing research focuses on function runtime optimization and ignores cold start time. For business scenarios with high real-time requirements, prolonged cold starts can affect business results. Therefore, cold-start optimization is particularly important for the application of function computing in latency-sensitive scenarios. To reduce the impact of cold start latency on services, this paper proposes a memory configuration to reduce cold start. Firstly, a memory-cost model is constructed based on memory resource rules and service computation time rules, and the model is optimized using a gradient descent algorithm. The results of large-scale simulations show that the memory selection scheme proposed in this paper can reduce the cold start latency by about 25% compared to the memory selection of conventional function services in existing cases.