What I try to do is get a lot of data about heroes in a game and save it in a DB, I use OkHttp to make request to the server and gson to parse the json and then save the classes I get from gson to the db by using an ORM from Jetbrains called Exposed.The calls are made in a loop, for each hero there will be 500 results about their last matches, there are 115 heroes, I let the thread sleep 1 sec before each request. The app starts running really fast, I can not even read the the results in the console, but after a while I get this:
I/zygote: Background concurrent copying GC freed 72775(3MB) AllocSpace objects, 5(5MB) LOS objects, 49% free, 5MB/11MB, paused 416us total 1.664s
and then the app runs really slow, I get 1 entry in the database/sec and at that point I expect to get another 15000. In the logcat I also get this
03-29 12:01:00.050 1634-1651/? W/android.os.Debug: failed to get memory consumption info: -1
03-29 12:01:00.059 1634-1651/? E/memtrack: Couldn't load memtrack module
the app does not crash, it just becomes extremely slow, The funny thing is that when I restart the app it is immediately slow, first time it got slow after 10 min, but then it is slow all the time. Also after I restart it writes things like
V/StudioProfiler: Loaded classes: 8137
Why would there be so many classes loaded if the app just started, what does this all mean I am a beginner and I really do not understand all this. Any ideas?
Thank you.