Hi Andrea,
Thanks for your reply.

The causes seem not about large memory cost, because this issue happened to several models with different sizes.
I think this issue is not related to my code, giving some code snippets might be a misleading instead. I use the standard code configuration which works fine several days ago and it indeed works fine in another server.

It’s really tricky to figure out the reasons for such a problem without applicable running environment. Thank you anyway.
Any other comments are definitely welcome!