In my project, I use volley to load the JSON stream, which I parse and list. To load data, I use the following method:
private void loadEventData(int year, final int month) {
The first call to this method works beautifully. In the second call, I get a timeout error. When I use the following command:
jr.setRetryPolicy(new DefaultRetryPolicy( 2500, DefaultRetryPolicy.DEFAULT_TIMEOUT_MS, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
to increase the request time, the request takes more than 30 seconds and produces the following log output:
10-19 20:53:19.746: D/Volley(17523): [2786] BasicNetwork.logSlowRequests: HTTP response for request=<[ ] http://************ 0x63ea5535 NORMAL 1> [lifetime=41769], [size=5467846], [rc=200], [retryCount=2] 10-19 20:53:19.796: D/dalvikvm(17523): GC_CONCURRENT freed 7462K, 26% free 24424K/33000K, paused 6ms+4ms, total 56ms 10-19 20:53:19.796: D/dalvikvm(17523): WAIT_FOR_CONCURRENT_GC blocked 51ms 10-19 20:53:19.826: I/dalvikvm-heap(17523): Grow heap (frag case) to 35.123MB for 10935708-byte allocation 10-19 20:53:19.857: D/dalvikvm(17523): GC_FOR_ALLOC freed 3K, 20% free 35100K/43680K, paused 23ms, total 28ms 10-19 20:53:19.917: D/dalvikvm(17523): GC_CONCURRENT freed 2018K, 19% free 35816K/43680K, paused 3ms+4ms, total 60ms 10-19 20:53:20.007: D/dalvikvm(17523): GC_CONCURRENT freed 4874K, 15% free 37226K/43680K, paused 2ms+3ms, total 27ms 10-19 20:53:20.007: D/dalvikvm(17523): WAIT_FOR_CONCURRENT_GC blocked 24ms 10-19 20:53:20.067: D/dalvikvm(17523): GC_FOR_ALLOC freed 5037K, 15% free 38601K/44900K, paused 19ms, total 19ms 10-19 20:53:20.117: D/dalvikvm(17523): GC_FOR_ALLOC freed 4680K, 14% free 40045K/46564K, paused 20ms, total 20ms 10-19 20:53:20.177: D/dalvikvm(17523): GC_FOR_ALLOC freed 5576K, 14% free 41572K/48272K, paused 20ms, total 20ms 10-19 20:53:20.227: D/dalvikvm(17523): GC_FOR_ALLOC freed 6133K, 15% free 43406K/50548K, paused 20ms, total 20ms 10-19 20:53:20.287: D/dalvikvm(17523): GC_CONCURRENT freed 6486K, 15% free 45029K/52428K, paused 2ms+2ms, total 24ms 10-19 20:53:20.287: D/dalvikvm(17523): WAIT_FOR_CONCURRENT_GC blocked 11ms 10-19 20:53:20.407: D/Volley(17523): [1] Request.finish: 42553 ms: [ ] http://****** 0x63ea5535 NORMAL 1
When I execute the same request in the browser, it only takes a few seconds. Why latency and incredible memory consumption?