2013-12-13 4 views
0

2 txt 파일 (SQLLite 데이터베이스가 더 좋을 것임)에서 데이터를 수집하는 Android 앱을 개발했습니다.이 파일은 1,25 MB 및 70 KB이므로 작고 짧지는 않습니다 (20000 라인). 그래서 내가하는 일은 AsyncTask 내부의 BufferedReader를 통해 양쪽 모두를 통과 한 다음 라인을 스크롤하는 ListView를 만드는 것입니다. 처음에는 그냥 몇 초 걸렸습니다하지만 좋았다 하나 개의 파일을 통해 실행,하지만 지금은 내가 AsyncTask를에 그것의 실행 입력해도 Android 앱이 다운 됨 : 메모리가 부족합니다.

The application may be doing too much in its main thread! 

받고 있어요 하나 AsyncTask를 (연속)에서 두 파일을 통해 실행 .. . 그리고 2기가바이트 RAM과 갤럭시 S4에

java.lang.OutOfMemoryError 

이이 실행중인 응용 프로그램 충돌, 그것은 2 텍스트 파일에 대한 충분하지 않겠습니까? 더 많은 메모리를 할당 할 수 있습니까?

감사합니다.

편집 :

ad = new Adapter(getActivity(), arrayParents); 
ad.setAll(arrayParents); 
mExpandableList.setAdapter(ad); 
pb.setVisibility(View.GONE); 
search.setEnabled(true); 

이 내 onPostExecute(), ListView에 약입니다. 20000 라인. 'pb'는 ProgressBar이고 'search'는 EditText입니다.

try { 
     AssetManager am = MainActivity.am; 
     BufferedReader br = new BufferedReader(new InputStreamReader(am.open("manuf.txt"))); 
     String line; 

     while ((line = br.readLine()) != null) { 
      if (!line.startsWith("#") || !line.startsWith(" ")) { 
       info.add(new ArrayList(Arrays.asList(line.split("[\t#]")))); 
      } 
     } 

     br = new BufferedReader(new InputStreamReader(am.open("pws.txt"))); 

     while ((line = br.readLine()) != null) { 
       pwuser.add(line.split(";")[4] + ";" + line.split(";")[5]); 
     } 

     br.close(); 
    } catch (FileNotFoundException e) { 
     System.out.println("FILE NOT FOUND!"); 
    } catch (IOException e) { 
     System.out.println("FILE ERROR!"); 

    } 

    for (int i = 0; i < info.size(); i++) { 
     Parent parent = new Parent(); 
     parent.setName(info.get(i).get(0)); 
     parent.setTry(info.get(i).get(1)); 
     parent.setTitle(info.get(i).get(0) + " - " + info.get(i).get(1)); 

     arrayChildren = new ArrayList<Children>(); 
     for (String s : pwuser) { 
      arrayChildren.add(new Children(s.split(";")[0], s.split(";")[1])); 
     } 
     parent.setArrayChildren(arrayChildren); 

     arrayParents.add(parent); 
    } 

내가 doInBackground() 안에 파일을 읽을 어떻게

73586K/81016K, paused 475ms, total 475ms 
12-13 22:59:59.253: D/dalvikvm(12888): GC_FOR_ALLOC freed 5938K, 9% free 75441K/82876K, paused 495ms, total 495ms 
12-13 23:00:00.194: D/dalvikvm(12888): GC_FOR_ALLOC freed 5928K, 9% free 77292K/84732K, paused 538ms, total 538ms 
12-13 23:00:01.125: D/dalvikvm(12888): GC_FOR_ALLOC freed 5912K, 9% free 79138K/86580K, paused 515ms, total 515ms 
12-13 23:00:02.036: D/dalvikvm(12888): GC_FOR_ALLOC freed 5900K, 9% free 80981K/88428K, paused 502ms, total 502ms 
12-13 23:00:02.826: D/dalvikvm(12888): GC_FOR_ALLOC freed 5888K, 9% free 82820K/90272K, paused 502ms, total 502ms 
12-13 23:00:03.867: D/dalvikvm(12888): GC_FOR_ALLOC freed 5877K, 9% free 84656K/92112K, paused 539ms, total 539ms 
12-13 23:00:04.738: D/dalvikvm(12888): GC_FOR_ALLOC freed 5861K, 8% free 86487K/93944K, paused 547ms, total 547ms 
12-13 23:00:05.559: D/dalvikvm(12888): GC_FOR_ALLOC freed 5849K, 8% free 88313K/95776K, paused 534ms, total 534ms 
12-13 23:00:06.450: D/dalvikvm(12888): GC_FOR_ALLOC freed 5838K, 8% free 90136K/97604K, paused 583ms, total 584ms 
12-13 23:00:07.321: D/dalvikvm(12888): GC_FOR_ALLOC freed 5825K, 8% free 91956K/99428K, paused 582ms, total 582ms 
12-13 23:00:08.192: D/dalvikvm(12888): GC_FOR_ALLOC freed 5810K, 8% free 93771K/101244K, paused 598ms, total 599ms 
12-13 23:00:09.163: D/dalvikvm(12888): GC_FOR_ALLOC freed 5799K, 8% free 95582K/103060K, paused 640ms, total 640ms 
12-13 23:00:10.104: D/dalvikvm(12888): GC_FOR_ALLOC freed 5786K, 8% free 97389K/104872K, paused 609ms, total 610ms 
12-13 23:00:11.014: D/dalvikvm(12888): GC_FOR_ALLOC freed 5775K, 8% free 99193K/106680K, paused 629ms, total 629ms 
12-13 23:00:11.985: D/dalvikvm(12888): GC_FOR_ALLOC freed 5763K, 7% free 100992K/108484K, paused 692ms, total 692ms 
12-13 23:00:13.177: D/dalvikvm(12888): GC_FOR_ALLOC freed 5750K, 7% free 102789K/110284K, paused 735ms, total 735ms 
12-13 23:00:13.187: I/Choreographer(12888): Skipped 44 frames! The application may be doing too much work on its main thread. 
12-13 23:00:14.318: D/dalvikvm(12888): GC_FOR_ALLOC freed 5739K, 7% free 104581K/112080K, paused 737ms, total 737ms 
12-13 23:00:14.318: I/Choreographer(12888): Skipped 43 frames! The application may be doing too much work on its main thread. 
12-13 23:00:15.489: D/dalvikvm(12888): GC_FOR_ALLOC freed 5725K, 7% free 106369K/113872K, paused 769ms, total 769ms 
12-13 23:00:15.489: I/Choreographer(12888): Skipped 45 frames! The application may be doing too much work on its main thread. 
12-13 23:00:16.670: D/dalvikvm(12888): GC_FOR_ALLOC freed 5714K, 7% free 108153K/115660K, paused 774ms, total 774ms 
12-13 23:00:16.670: I/Choreographer(12888): Skipped 46 frames! The application may be doing too much work on its main thread. 
12-13 23:00:17.691: D/dalvikvm(12888): GC_FOR_ALLOC freed 5700K, 7% free 109934K/117444K, paused 740ms, total 740ms 
12-13 23:00:17.691: I/Choreographer(12888): Skipped 44 frames! The application may be doing too much work on its main thread. 
12-13 23:00:18.902: D/dalvikvm(12888): GC_FOR_ALLOC freed 5689K, 7% free 111710K/119224K, paused 867ms, total 867ms 
12-13 23:00:18.902: I/Choreographer(12888): Skipped 51 frames! The application may be doing too much work on its main thread. 
12-13 23:00:20.103: D/dalvikvm(12888): GC_FOR_ALLOC freed 5676K, 7% free 113482K/121000K, paused 854ms, total 854ms 
12-13 23:00:20.103: I/Choreographer(12888): Skipped 50 frames! The application may be doing too much work on its main thread. 
12-13 23:00:21.304: D/dalvikvm(12888): GC_FOR_ALLOC freed 5663K, 7% free 115251K/122772K, paused 833ms, total 833ms 
12-13 23:00:21.304: I/Choreographer(12888): Skipped 49 frames! The application may be doing too much work on its main thread. 
12-13 23:00:24.468: D/dalvikvm(14883): GC_FOR_ALLOC freed 628K, 9% free 17871K/19600K, paused 18ms, total 18ms 
12-13 23:00:24.478: I/dalvikvm-heap(14883): Grow heap (frag case) to 20.213MB for 1774240-byte allocation 
12-13 23:00:24.498: D/dalvikvm(14883): GC_FOR_ALLOC freed 4K, 9% free 19600K/21336K, paused 17ms, total 17ms 
12-13 23:00:24.518: D/dalvikvm(14883): GC_FOR_ALLOC freed <1K, 9% free 19600K/21336K, paused 15ms, total 15ms 
12-13 23:00:24.548: I/dalvikvm-heap(14883): Grow heap (frag case) to 35.438MB for 15968032-byte allocation 
12-13 23:00:24.568: D/dalvikvm(14883): GC_FOR_ALLOC freed <1K, 5% free 35193K/36932K, paused 22ms, total 22ms 
12-13 23:00:24.598: D/dalvikvm(14883): GC_CONCURRENT freed <1K, 5% free 35193K/36932K, paused 2ms+1ms, total 29ms 
12-13 23:00:24.638: D/AbsListView(14883): Get MotionRecognitionManager 
12-13 23:00:24.648: D/ProgressBar(14883): setProgress = 0 
12-13 23:00:24.648: D/ProgressBar(14883): setProgress = 0, fromUser = false 
12-13 23:00:24.648: D/ProgressBar(14883): mProgress = 0mIndeterminate = false, mMin = 0, mMax = 100 
12-13 23:00:24.648: D/AbsListView(14883): unregisterIRListener() is called 
12-13 23:00:24.648: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=0, getHeight()=0, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......I. 0,0-0,0 #7f0b0006 app:id/expandable_list} 
12-13 23:00:24.658: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=0, getHeight()=0, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......I. 0,0-0,0 #7f0b0006 app:id/expandable_list} 
12-13 23:00:24.668: D/libEGL(14883): loaded /system/lib/egl/libEGL_adreno200.so 
12-13 23:00:24.668: D/libEGL(14883): loaded /system/lib/egl/libGLESv1_CM_adreno200.so 
12-13 23:00:24.668: D/libEGL(14883): loaded /system/lib/egl/libGLESv2_adreno200.so 
12-13 23:00:24.668: I/Adreno200-EGL(14883): <qeglDrvAPI_eglInitialize:265>: EGL 1.4 QUALCOMM build: (CL3544079) 
12-13 23:00:24.668: I/Adreno200-EGL(14883): Build Date: 03/28/13 Thu 
12-13 23:00:24.668: I/Adreno200-EGL(14883): Local Branch: adreno_20130328 
12-13 23:00:24.668: I/Adreno200-EGL(14883): Remote Branch: 
12-13 23:00:24.668: I/Adreno200-EGL(14883): Local Patches: 
12-13 23:00:24.668: I/Adreno200-EGL(14883): Reconstruct Branch: 
12-13 23:00:24.738: D/OpenGLRenderer(14883): Enabling debug mode 0 
12-13 23:00:24.738: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=0, getHeight()=0, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......I. 0,0-0,0 #7f0b0006 app:id/expandable_list} 
12-13 23:00:24.738: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=0, getHeight()=0, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......I. 0,0-0,0 #7f0b0006 app:id/expandable_list} 
12-13 23:00:24.738: D/AbsListView(14883): unregisterIRListener() is called 
12-13 23:00:24.738: I/endeffect(14883): AbsListView.onLayout(), getWidth()=984, getHeight()=1392, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......ID 48,165-1032,1557 #7f0b0006 app:id/expandable_list} 
12-13 23:00:24.738: D/ProgressBar(14883): updateDrawableBounds: left = 0 
12-13 23:00:24.738: D/ProgressBar(14883): updateDrawableBounds: top = 0 
12-13 23:00:24.738: D/ProgressBar(14883): updateDrawableBounds: right = 228 
12-13 23:00:24.738: D/ProgressBar(14883): updateDrawableBounds: bottom = 228 
12-13 23:00:25.118: D/AbsListView(14883): unregisterIRListener() is called 
12-13 23:00:25.138: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=984, getHeight()=1392, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......ID 48,165-1032,1557 #7f0b0006 app:id/expandable_list} 
12-13 23:00:25.138: I/endeffect(14883): AbsListView.onMeasure(), getWidth()=984, getHeight()=1392, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......ID 48,165-1032,1557 #7f0b0006 app:id/expandable_list} 
12-13 23:00:25.138: D/AbsListView(14883): unregisterIRListener() is called 
12-13 23:00:25.138: I/endeffect(14883): AbsListView.onLayout(), getWidth()=984, getHeight()=1392, this=android.widget.ExpandableListView{421acc28 V.ED.VC. ......ID 48,165-1032,1557 #7f0b0006 app:id/expandable_list} 
12-13 23:00:27.280: D/dalvikvm(14883): GC_CONCURRENT freed 4196K, 12% free 39191K/44484K, paused 3ms+35ms, total 100ms 
12-13 23:00:27.280: D/dalvikvm(14883): WAIT_FOR_CONCURRENT_GC blocked 68ms 
12-13 23:00:29.583: D/dalvikvm(14883): GC_CONCURRENT freed 4396K, 12% free 41918K/47516K, paused 3ms+33ms, total 114ms 
12-13 23:00:29.583: D/dalvikvm(14883): WAIT_FOR_CONCURRENT_GC blocked 104ms 
12-13 23:00:30.924: D/dalvikvm(14883): GC_FOR_ALLOC freed 7832K, 18% free 42046K/51152K, paused 121ms, total 122ms 
12-13 23:00:31.615: D/dalvikvm(14883): GC_FOR_ALLOC freed 6556K, 16% free 43454K/51324K, paused 116ms, total 116ms 
12-13 23:00:32.095: D/dalvikvm(14883): GC_FOR_ALLOC freed 6096K, 15% free 45340K/52744K, paused 122ms, total 122ms 
12-13 23:00:32.545: D/dalvikvm(14883): GC_FOR_ALLOC freed 6099K, 14% free 47232K/54628K, paused 141ms, total 141ms 
12-13 23:00:33.186: D/dalvikvm(14883): GC_FOR_ALLOC freed 6098K, 14% free 49126K/56520K, paused 165ms, total 165ms 
12-13 23:00:33.837: D/dalvikvm(14883): GC_FOR_ALLOC freed 6096K, 13% free 51025K/58416K, paused 192ms, total 192ms 
12-13 23:00:34.347: D/dalvikvm(14883): GC_FOR_ALLOC freed 6090K, 13% free 52922K/60316K, paused 200ms, total 200ms 
12-13 23:00:34.978: D/dalvikvm(14883): GC_FOR_ALLOC freed 6079K, 12% free 54818K/62212K, paused 229ms, total 229ms 
12-13 23:00:35.679: D/dalvikvm(14883): GC_FOR_ALLOC freed 6067K, 12% free 56712K/64108K, paused 274ms, total 274ms 
12-13 23:00:36.459: D/dalvikvm(14883): GC_FOR_ALLOC freed 6056K, 12% free 58603K/66004K, paused 307ms, total 307ms 
12-13 23:00:37.310: D/dalvikvm(14883): GC_FOR_ALLOC freed 6042K, 11% free 60490K/67892K, paused 312ms, total 312ms 
12-13 23:00:37.921: D/dalvikvm(14883): GC_FOR_ALLOC freed 6025K, 11% free 62370K/69776K, paused 301ms, total 301ms 
12-13 23:00:38.601: D/dalvikvm(14883): GC_FOR_ALLOC freed 6016K, 11% free 64249K/71660K, paused 343ms, total 343ms 
12-13 23:00:39.302: D/dalvikvm(14883): GC_FOR_ALLOC freed 6004K, 11% free 66125K/73540K, paused 363ms, total 363ms 
12-13 23:00:39.943: D/dalvikvm(14883): GC_FOR_ALLOC freed 5992K, 10% free 67996K/75416K, paused 348ms, total 348ms 
12-13 23:00:40.623: D/dalvikvm(14883): GC_FOR_ALLOC freed 5976K, 10% free 69862K/77284K, paused 376ms, total 376ms 
12-13 23:00:41.314: D/dalvikvm(14883): GC_FOR_ALLOC freed 5964K, 10% free 71725K/79152K, paused 374ms, total 374ms 
12-13 23:00:42.155: D/dalvikvm(14883): GC_FOR_ALLOC freed 5952K, 10% free 73584K/81016K, paused 399ms, total 399ms 
12-13 23:00:42.886: D/dalvikvm(14883): GC_FOR_ALLOC freed 5940K, 9% free 75439K/82876K, paused 426ms, total 426ms 
12-13 23:00:43.616: D/dalvikvm(14883): GC_FOR_ALLOC freed 5925K, 9% free 77290K/84728K, paused 446ms, total 446ms 
12-13 23:00:44.377: D/dalvikvm(14883): GC_FOR_ALLOC freed 5913K, 9% free 79137K/86580K, paused 463ms, total 463ms 
12-13 23:00:45.428: D/dalvikvm(14883): GC_FOR_ALLOC freed 5901K, 9% free 80980K/88428K, paused 625ms, total 625ms 
12-13 23:00:46.419: D/dalvikvm(14883): GC_FOR_ALLOC freed 5885K, 9% free 82818K/90268K, paused 484ms, total 484ms 
12-13 23:00:47.340: D/dalvikvm(14883): GC_FOR_ALLOC freed 5875K, 9% free 84653K/92108K, paused 525ms, total 525ms 
12-13 23:00:48.151: D/dalvikvm(14883): GC_FOR_ALLOC freed 5862K, 8% free 86484K/93944K, paused 526ms, total 526ms 
12-13 23:00:49.002: D/dalvikvm(14883): GC_FOR_ALLOC freed 5847K, 8% free 88310K/95772K, paused 553ms, total 553ms 
12-13 23:00:49.862: D/dalvikvm(14883): GC_FOR_ALLOC freed 5837K, 8% free 90133K/97600K, paused 566ms, total 566ms 
12-13 23:00:50.753: D/dalvikvm(14883): GC_FOR_ALLOC freed 5825K, 8% free 91952K/99424K, paused 601ms, total 601ms 
12-13 23:00:51.674: D/dalvikvm(14883): GC_FOR_ALLOC freed 5809K, 8% free 93766K/101240K, paused 605ms, total 605ms 
12-13 23:00:52.575: D/dalvikvm(14883): GC_FOR_ALLOC freed 5798K, 8% free 95577K/103056K, paused 626ms, total 626ms 
12-13 23:00:53.506: D/dalvikvm(14883): GC_FOR_ALLOC freed 5786K, 8% free 97385K/104868K, paused 636ms, total 636ms 
12-13 23:00:54.447: D/dalvikvm(14883): GC_FOR_ALLOC freed 5775K, 8% free 99188K/106676K, paused 656ms, total 656ms 
12-13 23:00:55.398: D/dalvikvm(14883): GC_FOR_ALLOC freed 5762K, 7% free 100988K/108480K, paused 663ms, total 663ms 
12-13 23:00:56.419: D/dalvikvm(14883): GC_FOR_ALLOC freed 5747K, 7% free 102783K/110276K, paused 697ms, total 697ms 
12-13 23:00:57.430: D/dalvikvm(14883): GC_FOR_ALLOC freed 5736K, 7% free 104574K/112072K, paused 722ms, total 722ms 
12-13 23:00:58.571: D/dalvikvm(14883): GC_FOR_ALLOC freed 5722K, 7% free 106363K/113864K, paused 794ms, total 794ms 
12-13 23:00:58.571: I/Choreographer(14883): Skipped 47 frames! The application may be doing too much work on its main thread. 
12-13 23:00:59.762: D/dalvikvm(14883): GC_FOR_ALLOC freed 5711K, 7% free 108146K/115652K, paused 763ms, total 763ms 
12-13 23:00:59.762: I/Choreographer(14883): Skipped 45 frames! The application may be doing too much work on its main thread. 
12-13 23:01:00.853: D/dalvikvm(14883): GC_FOR_ALLOC freed 5700K, 7% free 109926K/117436K, paused 774ms, total 774ms 
12-13 23:01:00.853: I/Choreographer(14883): Skipped 46 frames! The application may be doing too much work on its main thread. 
12-13 23:01:01.954: D/dalvikvm(14883): GC_FOR_ALLOC freed 5687K, 7% free 111702K/119216K, paused 790ms, total 791ms 
12-13 23:01:01.954: I/Choreographer(14883): Skipped 47 frames! The application may be doing too much work on its main thread. 
12-13 23:01:03.115: D/dalvikvm(14883): GC_FOR_ALLOC freed 5675K, 7% free 113474K/120992K, paused 863ms, total 863ms 
12-13 23:01:03.115: I/Choreographer(14883): Skipped 51 frames! The application may be doing too much work on its main thread. 
12-13 23:01:04.336: D/dalvikvm(14883): GC_FOR_ALLOC freed 5663K, 7% free 115242K/122764K, paused 885ms, total 885ms 
12-13 23:01:04.336: I/Choreographer(14883): Skipped 53 frames! The application may be doing too much work on its main thread. 
12-13 23:01:05.628: D/dalvikvm(14883): GC_FOR_ALLOC freed 5650K, 7% free 117007K/124532K, paused 857ms, total 858ms 
12-13 23:01:05.628: I/Choreographer(14883): Skipped 50 frames! The application may be doing too much work on its main thread. 
12-13 23:01:06.789: D/dalvikvm(14883): GC_FOR_ALLOC freed 5637K, 6% free 118767K/126296K, paused 858ms, total 858ms 
12-13 23:01:06.799: I/Choreographer(14883): Skipped 50 frames! The application may be doing too much work on its main thread. 
12-13 23:01:08.040: D/dalvikvm(14883): GC_FOR_ALLOC freed 5625K, 6% free 120524K/128056K, paused 940ms, total 940ms 
12-13 23:01:08.040: I/Choreographer(14883): Skipped 55 frames! The application may be doing too much work on its main thread. 
12-13 23:01:09.281: I/dalvikvm-heap(14883): Clamp target GC heap from 128.480MB to 128.000MB 
12-13 23:01:09.291: D/dalvikvm(14883): GC_FOR_ALLOC freed 5612K, 6% free 122276K/129812K, paused 899ms, total 899ms 
12-13 23:01:09.291: I/Choreographer(14883): Skipped 53 frames! The application may be doing too much work on its main thread. 
12-13 23:01:10.492: I/dalvikvm-heap(14883): Clamp target GC heap from 130.060MB to 128.000MB 
12-13 23:01:10.492: D/dalvikvm(14883): GC_FOR_ALLOC freed 5176K, 6% free 123895K/131072K, paused 923ms, total 923ms 
12-13 23:01:10.492: I/Choreographer(14883): Skipped 55 frames! The application may be doing too much work on its main thread. 
12-13 23:01:11.393: I/dalvikvm-heap(14883): Clamp target GC heap from 130.149MB to 128.000MB 
12-13 23:01:11.393: D/dalvikvm(14883): GC_FOR_ALLOC freed 298K, 6% free 123986K/131072K, paused 883ms, total 883ms 
12-13 23:01:11.393: I/dalvikvm-heap(14883): Forcing collection of SoftReferences for 6140-byte allocation 
12-13 23:01:12.304: I/dalvikvm-heap(14883): Clamp target GC heap from 130.141MB to 128.000MB 
12-13 23:01:12.304: D/dalvikvm(14883): GC_BEFORE_OOM freed 10K, 6% free 123976K/131072K, paused 910ms, total 910ms 
12-13 23:01:12.304: I/Choreographer(14883): Skipped 107 frames! The application may be doing too much work on its main thread. 
12-13 23:01:13.275: I/dalvikvm-heap(14883): Clamp target GC heap from 130.258MB to 128.000MB 
12-13 23:01:13.275: D/dalvikvm(14883): GC_FOR_ALLOC freed 393K, 6% free 124096K/131072K, paused 941ms, total 941ms 
12-13 23:01:13.275: I/dalvikvm-heap(14883): Forcing collection of SoftReferences for 6140-byte allocation 
12-13 23:01:14.376: I/dalvikvm-heap(14883): Clamp target GC heap from 130.258MB to 128.000MB 
12-13 23:01:14.376: D/dalvikvm(14883): GC_BEFORE_OOM freed <1K, 6% free 124095K/131072K, paused 1102ms, total 1102ms 
12-13 23:01:14.376: E/dalvikvm-heap(14883): Out of memory on a 6140-byte allocation. 
12-13 23:01:14.376: I/dalvikvm(14883): "AsyncTask #1" prio=5 tid=12 RUNNABLE 
12-13 23:01:14.376: I/dalvikvm(14883): | group="main" sCount=0 dsCount=0 obj=0x4220b980 self=0x6d20e510 
12-13 23:01:14.376: I/dalvikvm(14883): | sysTid=14951 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1829392536 
12-13 23:01:14.376: I/dalvikvm(14883): | state=R schedstat=(0 0 0) utm=4406 stm=104 core=0 
12-13 23:01:14.376: I/dalvikvm(14883): at java.util.ArrayList.add(ArrayList.java:~114) 
12-13 23:01:14.376: I/dalvikvm(14883): at com.redox.defaultrouter.ListFragment.fill(ListFragment.java:135) 
12-13 23:01:14.376: I/dalvikvm(14883): at com.redox.defaultrouter.ListFragment$PostTask.doInBackground(ListFragment.java:161) 
12-13 23:01:14.376: I/dalvikvm(14883): at com.redox.defaultrouter.ListFragment$PostTask.doInBackground(ListFragment.java:1) 
12-13 23:01:14.376: I/dalvikvm(14883): at android.os.AsyncTask$2.call(AsyncTask.java:287) 
12-13 23:01:14.376: I/dalvikvm(14883): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
12-13 23:01:14.376: I/dalvikvm(14883): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
12-13 23:01:14.376: I/dalvikvm(14883): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
12-13 23:01:14.376: I/dalvikvm(14883): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
12-13 23:01:14.376: I/dalvikvm(14883): at java.lang.Thread.run(Thread.java:856) 
12-13 23:01:14.376: I/Choreographer(14883): Skipped 55 frames! The application may be doing too much work on its main thread. 
12-13 23:01:14.386: W/dalvikvm(14883): threadid=12: thread exiting with uncaught exception (group=0x40f60ac8) 
12-13 23:01:14.386: E/AndroidRuntime(14883): FATAL EXCEPTION: AsyncTask #1 
12-13 23:01:14.386: E/AndroidRuntime(14883): java.lang.RuntimeException: An error occured while executing doInBackground() 
12-13 23:01:14.386: E/AndroidRuntime(14883): at android.os.AsyncTask$3.done(AsyncTask.java:299) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:352) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.FutureTask.setException(FutureTask.java:219) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.FutureTask.run(FutureTask.java:239) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.lang.Thread.run(Thread.java:856) 
12-13 23:01:14.386: E/AndroidRuntime(14883): Caused by: java.lang.OutOfMemoryError 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.ArrayList.add(ArrayList.java:114) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at com.redox.defaultrouter.ListFragment.fill(ListFragment.java:135) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at com.redox.defaultrouter.ListFragment$PostTask.doInBackground(ListFragment.java:161) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at com.redox.defaultrouter.ListFragment$PostTask.doInBackground(ListFragment.java:1) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at android.os.AsyncTask$2.call(AsyncTask.java:287) 
12-13 23:01:14.386: E/AndroidRuntime(14883): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 
12-13 23:01:14.386: E/AndroidRuntime(14883): ... 4 more 
12-13 23:01:24.236: I/Choreographer(14883): Skipped 587 frames! The application may be doing too much work on its main thread. 
+2

우리가 당신의 마음을 읽을 수 없으면 일부 코드를 게시하십시오! –

+1

onPostExecute() 메서드에서 무엇을하고 있습니까? 기본 UI 스레드에서 발생하는 문제를 보여줄 수 있습니까? –

+0

코드를 보지 않고도 많은 것을 말할 수는 없지만 listview가 필요한지 모르겠다. 아마도 스크롤 뷰 내부에 TextView가 하나 또는 두 개 더있는 것처럼 보일 것입니다. – Submersed

답변

0

사용하기 때문에 API>는 설정을 시도 제공 할 수 있습니다 (11) (갤럭시 S4) :

안드로이드 :

http://developer.android.com/guide/topics/manifest/application-element.html

largeHeap

하지만 메모리 문제 일 가능성이 큽니다. 메모리 부족을 위해 stacktrace도 게시 하시겠습니까?

+0

고마워,하지만 그게 도움이 안됐어, 응용 프로그램이 100 프레임을 건너 뛰고, 극도로 뒤떨어지면서, stacktrace를 게시 할 것입니다. – moritzg

+0

Stacktrace로 업데이트 – moritzg

+0

ArrayList에 줄을 저장했기 때문일 수 있습니까? – moritzg

1

당신은 또한 OpenCSV

사용해야합니다, 당신은 이미 스스로 말한 알고,하지만 당신은 여전히 ​​정말로 데이터를 구문 분석하는 SQLite는을 사용해야합니다. SQLite를 사용하면 응용 프로그램이 RAM에 모든 것을 보관할 필요가 없기 때문에 메모리 문제가 모두 사라집니다.

관련 문제