kotlin翻新 – 背景粘性并发标记扫描GC释放65326(1448KB)AllocSpace对象,62(1736KB)LOS对象,

我试图做一个简单的REST请求与Kotlin Retrofit和我得到了很多的GC错误。 我真的不知道如何解决这个问题。 我试图把更多的内存放在模拟器上,但问题仍然存在。

我的代码是:

val retrofit =Retrofit.Builder().baseUrl("Url") .addConverterFactory(GsonConverterFactory.create()) .build() val retrofitAPI = retrofit.create(ApiServices::class.java) val call = retrofitAPI.getBarcharts(dashboardRequestBean) call.enqueue(object : Callback<ResponseChartModel<BaseChartModel>> { override fun onResponse(call: Call<ResponseChartModel<BaseChartModel>>? , response: Response<ResponseChartModel<BaseChartModel>>?) { TODO("not implemented") //To change body of created functions use File | Settings | File Templates. } override fun onFailure(call: Call<ResponseChartModel<BaseChartModel>>?, t: Throwable?) { Toast.makeText(this@MainActivity, t?.message, Toast.LENGTH_SHORT).show() } }) 

接口ApiServices

  @POST("getDashlet")fun getBarcharts(@Body dashboardRequestBean: DashboardRequestBean): Call<ResponseChartModel<BaseChartModel>> 

例外:

  FinalizerDaemon: finalize objects = 216 06-15 09:16:14.928 6920-6931/ssa.abc.alrais.kotlindemo I/art: Background sticky concurrent mark sweep GC freed 65326(1448KB) AllocSpace objects, 62(1736KB) LOS objects, 36% free, 4MB/7MB, paused 5.406ms total 36.953ms 06-15 09:16:15.118 6920-6931/ssa.abc.alrais.kotlindemo I/art: Background partial concurrent mark sweep GC freed 69034(1527KB) AllocSpace objects, 72(2008KB) LOS objects, 39% free, 5MB/8MB, paused 5.698ms total 65.069ms 06-15 09:16:15.340 6920-6931/ssa.abc.alrais.kotlindemo I/art: Background sticky concurrent mark sweep GC freed 75548(1650KB) AllocSpace objects, 70(1960KB) LOS objects, 36% free, 5MB/8MB, paused 6.638ms total 49.777ms 06-15 09:16:15.559 6920-6931/ssa.abc.alrais.kotlindemo I/art: Background partial concurrent mark sweep GC freed 79831(1715KB) AllocSpace objects, 71(2MB) LOS objects, 40% free, 5MB/9MB, paused 6.345ms total 75.652ms 

android.app.LauncherActivity.ListItem用于显示可以针对给定意图执行的所有活动的列表。 点击时启动。

所以请检查你的ListItem bean包。