Java kotlin改装背景粘性并发标记扫描GC释放了65326(1448KB)个AllocSpace对象,62(1736KB)个LOS对象,

Java kotlin改装背景粘性并发标记扫描GC释放了65326(1448KB)个AllocSpace对象,62(1736KB)个LOS对象,,java,android,kotlin,sticky,Java,Android,Kotlin,Sticky,我试图通过在kotlin中进行改造来提出一个简单的REST请求,但我得到了很多GC错误。我真的不知道怎么修。我试图在emulator上增加内存,但问题仍然存在 我的代码是: val retrofit =Retrofit.Builder().baseUrl("Url") .addConverterFactory(GsonConverterFactory.create()) .build() val retrofitAPI = retrofit.cr

我试图通过在kotlin中进行改造来提出一个简单的REST请求,但我得到了很多GC错误。我真的不知道怎么修。我试图在emulator上增加内存,但问题仍然存在

我的代码是:

    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()
        }

    })

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


所以请检查您的ListItembean包

但这也不例外,这只是垃圾收集器logsok..解决方案请..什么解决方案?这不是问题,只是记录而已。Android总是显示GC日志。也许你有太多的分配,也许没有。您可以使用Android Studio内存监视器和分配跟踪器检查内存的运行情况。顺便说一句,这与Kotlin无关。我能得到ResponseChartModelclass ResponseChartModel:BaseSponse()的完整结构吗?{var content:BaseChartModel?=null}谢谢asnad。这只是个错误。我是android新手
  @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