Java program is getting slower after running for a while

前端 未结 7 1407
天涯浪人
天涯浪人 2021-02-04 03:20

I have a java program that is a typical machine learning algorithm, updating the values for some parameters by some equations:

for (int iter=0; iter<1000; ite         


        
7条回答
  •  感情败类
    2021-02-04 04:01

    First, it is a common best practice to declare Variables outside of loops to avoid garbace collection. as 'Wagner Tsuchiya' said, try running a profiler if you have doubts about the GC. If you want some tips on GC tuning, i found nice blogpost.

提交回复
热议问题