Xcode freeze

I bought a MacBook 2019 and after install Monterey Xcode started to freeze or at run after 20 to 30 minute any suggestions how to fix or improve this situation ?

I found out that Xcode created like 10 gb on memory cache somebody the reason for that

Xcode freeze
 
 
Q