Jenkins build failed

During some jenkins build cpu percentage is going 99 % and build gets struck.After restarting the build is success. If it is due infra of the server it happens to every build.but it happening for only few builds.
Can u provide me a solution or suggestion to resolve this issue.

A post was merged into an existing topic: Jenkins build is getting struck