我在一项活动中有这个:
public void onCreate(Bundle savedInstanceState) {
time=(EditText) findViewById(R.id.time);
...
public void mass_func(){
...
double ttime=Double.parseDouble(time.getText().toString().trim());
double res=mass*(Math.pow(0.5,ttime/half_time));
....
//filling the array
int temp=(int) ttime;
ArrayList <MyDouble> final_mass=new ArrayList <MyDouble>(temp);//i want the size to be maximum as the ttime
for (int i=0;i<=temp;i++){
MyDouble m1=new MyDouble(mass*(Math.pow(0.5,i/half_time)));
final_mass.add(m1);
}
Intent i=new Intent(this,mass_calcs.class);
...
i.putExtra("time",ttime);
i.putParcelableArrayListExtra("final_mass",final_mass);
startActivity(i);
}
从mass_calcs活动我只是将值传递给LineGraph活动。 LineGraph活动是:
public class LineGraph_mass extends Activity {
...
private Double ttime;
//ArrayList <MyDouble> final_mass=new ArrayList <MyDouble>(ttime.intValue());
ArrayList <MyDouble> final_mass=new ArrayList <MyDouble>( 10000);
问题是,当用户输入大约'4000'的时间值时,应用程序崩溃。 我收到错误“GC_FOR_MALLOC释放...”这意味着内存泄漏。
从我所做的阅读中,我看到一种方法可以让arraylist达到一定的规模。
但我怎么能在我的情况下这样做?
我正在定义“ArrayList final_mass = new ArrayList(temp);”在第一个活动,并尝试像“... =新的ArrayList(ttime.intValue());”在LineGraph,但它不会工作。
(我也试过像“...... =新的ArrayList(10000)”但它也不起作用。
-------------- UPDATE -----------------------------
这是log.txt
....
I/ActivityManager(59): Starting activity: Intent { cmp=com....Radiation/.mass_calcs (has extras) }
E/JavaBinder(59): !!! FAILED BINDER TRANSACTION !!!
W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
W/ActivityManager(59): Activity idle timeout for HistoryRecord{4403c310 com...Radiation/.mass_calcs}
W/WindowManager(59): Key dispatching timed out sending to <null>: no window ready for key dispatch
W/WindowManager(59): Previous dispatch state: {{KeyEvent{action=1 code=10 repeat=0 meta=0 scancode=4 mFlags=8} to Window{..Radiation/com.w..o.Radiation.number_mass paused=false} @ 1329130580604 lw=Window{440288e8 com....Radiation/com....Radiation.number_mass paused=false} lb=android.os.BinderProxy@43ff0990 fin=false gfw=true ed=true tts=0 wf=true fp=false mcf=Window{440288e8 com....Radiation/com...adiation.number_mass paused=false}}}
W/WindowManager(59): Current dispatch state: {{KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to null @ 1329130602027 lw=null lb=null fin=true gfw=true ed=true tts=0 wf=false fp=false mcf=null}}
I/Process(59): Sending signal. PID: 277 SIG: 3
I/dalvikvm(277): threadid=3: reacting to signal 3
I/dalvikvm(277): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 59 SIG: 3
I/dalvikvm(59): threadid=3: reacting to signal 3
I/dalvikvm(59): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 118 SIG: 3
I/dalvikvm(118): threadid=3: reacting to signal 3
I/dalvikvm(118): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 260 SIG: 3
I/dalvikvm(260): threadid=3: reacting to signal 3
I/dalvikvm(260): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 197 SIG: 3
I/dalvikvm(197): threadid=3: reacting to signal 3
I/dalvikvm(197): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 244 SIG: 3
I/dalvikvm(244): threadid=3: reacting to signal 3
...
I/dalvikvm(251): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 127 SIG: 3
I/dalvikvm(127): threadid=3: reacting to signal 3
I/dalvikvm(127): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 223 SIG: 3
I/dalvikvm(223): threadid=3: reacting to signal 3
I/dalvikvm(223): Wrote stack traces to '/data/anr/traces.txt'
I/Process(59): Sending signal. PID: 208 SIG: 3
I/dalvikvm(208): threadid=3: reacting to signal 3
I/dalvikvm(208): Wrote stack traces to '/data/anr/traces.txt'
I/P....
E/ActivityManager(59): ANR in com....Radiation (com....Radiation/.mass_calcs)
E/ActivityManager(59): Reason: keyDispatchingTimedOut
E/ActivityManager(59): Load: 2.15 / 1.13 / 0.43
E/ActivityManager(59): CPU usage from 17754ms to 45ms ago:
E/ActivityManager(59): system_server: 4% = 2% user + 1% kernel / faults: 887 minor 13 major
E/ActivityManager(59): evgeo.Radiation: 0% = 0% user + 0% kernel / faults: 190 minor 6 major
E/ActivityManager(59): m.android.phone: 0% = 0% user + 0% kernel / faults: 300 minor
E/ActivityManager(59): ndroid.settings: 0% = 0% user + 0% kernel / faults: 355 minor
E/ActivityManager(59): d.process.acore: 0% = 0% user + 0% kernel / faults: 188 minor
E/ActivityManager(59): d.process.media: 0% = 0% user + 0% kernel / faults: 157 minor
...
E/ActivityManager(59): roid.alarmclock: 0% = 0% user + 0% kernel / faults: 174 minor
E/ActivityManager(59): id.defcontainer: 0% = 0% user + 0% kernel / faults: 156 minor
E/ActivityManager(59): android.protips: 0% = 0% user + 0% kernel / faults: 156 minor
E/ActivityManager(59): m.android.music: 0% = 0% user + 0% kernel / faults: 155 minor
...
E/ActivityManager(59): TOTAL: 7% = 4% user + 3% kernel
D/dalvikvm(59): GC_FOR_MALLOC freed 5076 objects / 300544 bytes in 186ms
02-13 12:56:42.976: W/WindowManager(59): No focus window, dropping: KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=8}
02-13 12:56:43.147: D/dalvikvm(59): GC_FOR_MALLOC freed 443 objects / 21488 bytes in 157ms
02-13 12:56:43.147: I/dalvikvm-heap(59): Grow heap (frag case) to 5.071MB for 81076-byte allocation
02-13 12:56:43.306: D/dalvikvm(59): GC_FOR_MALLOC freed 144 objects / 7200 bytes in 158ms
02-13 12:56:43.446: D/dalvikvm(59): GC_FOR_MALLOC freed 298 objects / 99376 bytes in 138ms
02-13 12:56:43.446: I/dalvikvm-heap(59): Grow heap (frag case) to 5.163MB for 162136-byte allocation
02-13 12:56:43.586: D/dalvikvm(59): GC_FOR_MALLOC freed 103 objects / 4600 bytes in 143ms
02-13 12:56:43.917: D/dalvikvm(59): GC_FOR_MALLOC freed 118 objects / 228512 bytes in 304ms
02-13 12:56:44.307: D/dalvikvm(59): GC_FOR_MALLOC freed 45 objects / 167704 bytes in 348ms
02-13 12:56:45.257: I/ARMAssembler(59): generated scanline__00000077:03515104_00000000_00000000 [ 33 ipp] (47 ins) at [0x2429d8:0x242a94] in 20482216 ns
02-13 12:56:46.666: W/ActivityManager(59): Force finishing activity com..Radiation/.mass_calcs
02-13 12:56:46.676: I/ActivityManager(59): Killing com..Radiation (pid=277): user's request
02-13 12:56:46.676: I/Process(59): Sending signal. PID: 277 SIG: 9
02-13 12:56:46.729: I/ActivityManager(59): Process com....Radiation (pid 277) has died.
02-13 12:56:46.766: I/WindowManager(59): WIN DEATH: Window{4
02-13 12:56:46.766: I/WindowManager(59): WIN DEATH: Window{4com....Radiation for activity com...o.Radiation/.Radiation: pid=284 uid=10043 gids={3003}
02-13 12:56:47.406: W/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 277 uid 10043
02-13 12:56:47.987: I/ActivityManager(59): Displayed activity com....Radiation/.Radiation: 1237 ms (total 22978 ms)
02-13 12:57:02.616: I/ActivityManager(59): Starting activity: Intent { cmp=c...Radiation/.number_mass }
02-13 12:57:03.076: I/ActivityManager(59): Displayed activity com....Radiation/.number_mass: 451 ms (total 451 ms)
02-13 12:57:03.786: W/KeyCharacterMap(284): No keyboard for id 0
02-13 12:57:03.786: W/KeyCharacterMap(284): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-13 12:57:09.786: D/dalvikvm(284): GC_FOR_MALLOC freed 1788 objects / 107184 bytes in 105ms
02-13 12:57:10.346: D/dalvikvm(284): GC_FOR_MALLOC freed 5790 objects / 531000 bytes in 98ms
02-13 12:57:10.897: D/dalvikvm(284): GC_FOR_MALLOC freed 5888 objects / 518296 bytes in 99ms
02-13 12:57:11.376: I/ActivityManager(59): Starting activity: Intent { cmp=com..Radiation/.mass_calcs (has extras) }
02-13 12:57:11.486: E/JavaBinder(59): !!! FAILED BINDER TRANSACTION !!!
02-13 12:57:21.396: W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
02-13 12:57:21.491: W/ActivityManager(59): Activity idle timeout for HistoryRecord{43fe82b0 com.wordpress.androiddevgeo.Radiation/.mass_calcs}
02-13 13:00:05.503: W/WindowManager(59): Key dispatching timed out sending to <null>: no window ready for key dispatch
02-13 13:00:05.503: W/WindowManager(59): Previous dispatch state: {{KeyEvent{action=1 code=10 repeat=0 meta=0 scancode=4 mFlags=8} to Window{4...lb=android.os.BinderProxy@43eb9200 fin=false gfw=true ed=true tts=0 wf=false fp=false mcf=Window{4403c720 ...
02-13 13:00:05.506: W/WindowManager(59): Current dispatch state: {{KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=8} to null @ 1329130805506 lw=null lb=null fin=true gfw=true ed=true tts=0 wf=false fp=false mcf=null}}
02-13 13:00:05.506: I/Process(59): Sending signal. PID: 284 SIG: 3
02-13 13:00:05.506: I/dalvikvm(284): threadid=3: reacting to signal 3
02-13 13:00:05.526: I/dalvikvm(284): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:00:05.526: I/Process(59): Sending signal. PID: 59 SIG: 3
02-13 13:00:05.526: I/dalvikvm(59): threadid=3: reacting to signal 3
02-13 13:00:05.596: I/dalvikvm(59): Wrote stack traces to '/data/anr/traces.txt'
...
02....
02-13 13:00:05.827: I/dalvikvm(133): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:00:05.897: E/ActivityManager(59): ANR in com....Radiation (com.....Radiation/.mass_calcs)
02-13 13:00:05.897: E/ActivityManager(59): Reason: keyDispatchingTimedOut
02-13 13:00:05.897: E/ActivityManager(59): Load: 0.08 / 0.59 / 0.35
02-13 13:00:05.897: E/ActivityManager(59): CPU usage from 203216ms to 49ms ago:
02-13 13:00:05.897: E/ActivityManager(59): system_server: 3% = 2% user + 0% kernel / faults: 3251 minor 18 major
02-13 13:00:05.897: E/ActivityManager(59): m.android.phone: 0% = 0% user + 0% kernel / faults: 78 minor
02-13 13:00:05.897: E/ActivityManager(59): ronsoft.openwnn: 0% = 0% user + 0% kernel / faults: 169 minor 1 major
02-13 13:00:05.897: E/ActivityManager(59): zygote: 0% = 0% user + 0% kernel / faults: 174 minor 1 major
02-13 13:00:05.897: E/ActivityManager(59): adbd: 0% = 0% user + 0% kernel
02-13 13:00:05.897: E/ActivityManager(59): servicemanager: 0% = 0% user + 0% kernel
02-13 13:00:05.897: E/ActivityManager(59): ndroid.launcher: 0% = 0% user + 0% kernel / faults: 40 minor
...0% kernel / faults: 36 minor
02-13 13:00:05.897: E/ActivityManager(59): .quicksearchbox: 0% = 0% user + 0% kernel ...
kernel / faults: 36 minor
02-13 13:00:05.897: E/ActivityManager(59): +evgeo.Radiation: 0% = 0% user + 0% kernel
02-13 13:00:05.897: E/ActivityManager(59): -evgeo.Radiation: 0% = 0% user + 0% kernel
02-13 13:00:05.897: E/ActivityManager(59): TOTAL: 5% = 4% user + 1% kernel + 0% iowait + 0% softirq
02-13 13:00:05.917: W/WindowManager(59): No focus window, dropping: KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=8}
02-13 13:00:06.087: D/dalvikvm(59): GC_FOR_MALLOC freed 2754 objects / 465896 bytes in 161ms
02-13 13:00:06.246: D/dalvikvm(59): GC_FOR_MALLOC freed 246 objects / 92832 bytes in 140ms
02-13 13:00:06.406: D/dalvikvm(59): GC_FOR_MALLOC freed 104 objects / 228008 bytes in 141ms
02-13 13:00:06.566: D/dalvikvm(59): GC_FOR_MALLOC freed 24 objects / 166848 bytes in 138ms
02-13 13:00:09.887: W/ActivityManager(59): Force finishing activity com....Radiation/.mass_calcs
02-13 13:00:09.899: I/ActivityManager(59): Killing com...eo.Radiation (pid=284): user's request
02-13 13:00:09.899: I/Process(59): Sending signal. PID: 284 SIG: 9
02-13 13:00:09.937: I/ActivityManager(59): Process com.w..eo.Radiation (pid 284) has died.
02-13 13:00:09.967: I/WindowManager(59): WIN DEATH: Window{43e98028 com....Radiation/com...Radiation.Radiation paused=false}
02-13 13:00:09.967: I/WindowManager(59): WIN DEATH: Window{4403c720 com....Radiation/com...Radiation.number_mass paused=false}
02-13 13:00:09.977: I/ActivityManager(59): Start proc com...adiation for activity com....Radiation/.Radiation: pid=291 uid=10043 gids={3003}
02-13 13:00:10.556: W/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 284 uid 10043
02-13 13:00:11.126: I/ActivityManager(59): Displayed activity com...o.Radiation/.Radiation: 1171 ms (total 179719 ms)
02-13 13:00:35.116: D/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol
02-13 13:00:55.099: D/dalvikvm(59): Debugger has detached; object registry had 1 entries
02-13 13:02:48.456: I/ActivityManager(59): Starting activity: Intent { cmp=com...o.Radiation/.read }
02-13 13:02:51.392: I/ActivityManager(59): Displayed activity com.w...Radiation/.read: 2723 ms (total 2723 ms)
02-13 13:03:29.026: D/AndroidRuntime(305): > AndroidRuntime START
02-13 13:03:29.026: D/AndroidRuntime(305): CheckJNI is ON
02-13 13:03:29.236: D/AndroidRuntime(305): --- registering native functions ---
02-13 13:03:30.366: D/dalvikvm(185): GC_EXPLICIT freed 363 objects / 22088 bytes in 96ms
02-13 13:03:30.867: D/PackageParser(59): Scanning package: /data/app/vmdl68554.tmp
02-13 13:03:31.246: I/PackageManager(59): Removing non-system package:com...o.Radiation
02-13 13:03:31.246: I/ActivityManager(59): Force stopping package com...Radiation uid=10043
02-13 13:03:31.266: I/Process(59): Sending signal. PID: 291 SIG: 9
02-13 13:03:31.277: I/ActivityManager(59): Force finishing activity HistoryRecord{43fb3a00 com.w..adiation/.Radiation}
02-13 13:03:31.306: I/UsageStats(59): Unexpected resume of com.android.launcher while already resumed in com.w...Radiation
02-13 13:03:31.317: I/WindowManager(59): WIN DEATH: Window{43fcc188 com....Radiation/com..o.Radiation.Radiation paused=true}
02-13 13:03:31.317: I/WindowManager(59): WIN DEATH: Window{43ff4430 com....Radiation/com....Radiation.read paused=false}
02-13 13:03:31.356: W/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 291 uid 10043
02-13 13:03:31.737: D/PackageManager(59): Scanning package com...Radiation
02-13 13:03:31.747: I/PackageManager(59): Package com...o.Radiation codePath changed from /data/app/com.wordpress.androiddevgeo.Radiation-2.apk to /data/app/com.w..o.Radiation-1.apk; Retaining data and using new
02-13 13:03:31.747: I/PackageManager(59): /data/app/com....Radiation-1.apk changed; unpacking
02-13 13:03:31.757: D/installd(35): DexInv: --- BEGIN '/data/app/com...o.Radiation-1.apk' ---
02-13 13:03:32.406: D/dalvikvm(314): DexOpt: load 83ms, verify 367ms, opt 14ms
02-13 13:03:32.416: D/installd(35): DexInv: --- END '/data/app/com....Radiation-1.apk' (success) ---
02-13 13:03:32.426: W/PackageManager(59): Code path for pkg : com....Radiation changing from /data/app/com....Radiation-2.apk to /data/app/com...Radiation-1.apk
02-13 13:03:32.426: W/PackageManager(59): Resource path for pkg : com....Radiation changing from /data/app/com....adiation-2.apk to /data/app/com....Radiation-1.apk
02-13 13:03:32.426: D/PackageManager(59): Activities:. .Radiation.Radiation .core_calcs c.Radiation.mass_calcs com....Radiation.number_cores com..Radiation.number_mass com....Radiation.help com...Radiation.help_mass com...Radiation.read org...com...Radiation.LineGraph com....Radiation.LineGraph_mass
02-13 13:03:32.587: D/dalvikvm(59): GC_FOR_MALLOC freed 5700 objects / 677864 bytes in 154ms
02-13 13:03:32.607: I/ActivityManager(59): Force stopping package comon uid=10043
02-13 13:03:32.797: I/installd(35): move /data/dalvik-cache/data@app@com
02-13 13:03:32.797: D/PackageManager(59): New package installed in /data/app/com.
02-13 13:03:33.016: I/ActivityManager(59): Force stopping package com.wordpress.androiddevgeo.Radiation uid=10043
02-13 13:03:33.126: D/dalvikvm(129): GC_EXPLICIT freed 1143 objects / 62248 bytes in 102ms
02-13 13:03:33.336: D/dalvikvm(162): GC_EXPLICIT freed 2035 objects / 103800 bytes in 160ms
02-13 13:03:33.517: W/RecognitionManagerService(59): no available voice recognition services found
02-13 13:03:33.956: D/dalvikvm(59): GC_EXPLICIT freed 5880 objects / 365616 bytes in 259ms
02-13 13:03:34.006: I/installd(35): unlink /data/dalvik-cache/data@app@com.wordpress.androiddevgeo.Radiation-2.apk@classes.dex
02-13 13:03:34.026: D/AndroidRuntime(305): Shutting down VM
02-13 13:03:34.036: D/dalvikvm(305): Debugger has detached; object registry had 1 entries
02-13 13:03:34.066: I/AndroidRuntime(305): NOTE: attach of thread 'Binder Thread #3' failed
D/AndroidRuntime(320): AndroidRuntime START
D/AndroidRuntime(320): CheckJNI is ON
D/AndroidRuntime(320): --- registering native functions ---
I/ActivityManager(59): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.wordpress.androiddevgeo.Radiation/.Radiation }
02-13 13:03:35.986: D/AndroidRuntime(320): Shutting down VM
02-13 13:03:36.006: D/dalvikvm(320): Debugger has detached; object registry had 1 entries
02-13 13:03:36.087: I/AndroidRuntime(320): NOTE: attach of thread 'Binder Thread #3' failed
02-13 13:03:36.087: I/ActivityManager(59): Start proc com.wordpress.androiddevgeo.Radiation for activity com.wordpress.androiddevgeo.Radiation/.Radiation: pid=327 uid=10043 gids={3003}
02-13 13:03:38.047: I/ActivityManager(59): Displayed activity com.wordpress.androiddevgeo.Radiation/.Radiation: 2072 ms (total 2072 ms)
02-13 13:03:39.266: I/ActivityManager(59): Starting activity: Intent { cmp=com.wordpress.androiddevgeo.Radiation/.number_mass }
02-13 13:03:39.847: I/ActivityManager(59): Displayed activity com.wordpress.androiddevgeo.Radiation/.number_mass: 557 ms (total 557 ms)
02-13 13:03:40.196: W/KeyCharacterMap(327): No keyboard for id 0
02-13 13:03:40.196: W/KeyCharacterMap(327): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
02-13 13:03:44.956: D/dalvikvm(129): GC_EXPLICIT freed 868 objects / 50432 bytes in 106ms
02-13 13:03:46.026: D/dalvikvm(327): GC_FOR_MALLOC freed 2384 objects / 179232 bytes in 97ms
02-13 13:03:46.567: D/dalvikvm(327): GC_FOR_MALLOC freed 6370 objects / 552192 bytes in 94ms
02-13 13:03:47.436: I/ActivityManager(59): Starting activity: Intent { cmp=com.wordpress.androiddevgeo.Radiation/.mass_calcs (has extras) }
02-13 13:03:47.517: E/JavaBinder(59): !!! FAILED BINDER TRANSACTION !!!
02-13 13:03:57.451: W/ActivityManager(59): Launch timeout has expired, giving up wake lock!
02-13 13:03:57.523: W/ActivityManager(59): Activity idle timeout for HistoryRecord{43ff11a0 com.wordpress.androiddevgeo.Radiation/.mass_calcs}
02-13 13:04:05.156: D/dalvikvm(185): GC_EXPLICIT freed 214 objects / 14840 bytes in 98ms
02-13 13:04:10.167: D/dalvikvm(260): GC_EXPLICIT freed 764 objects / 55248 bytes in 96ms
02-13 13:04:24.727: W/WindowManager(59): Key dispatching timed out sending to <null>: no window ready for key dispatch
02-13 13:04:24.727: W/WindowManager(59): Previous dispatch state: {{KeyEvent{...
02-13 13:04:24.727: W/WindowManager(59): Current dispatch state: {{KeyEvent{act..
......
02-13 13:04:24.887: I/dalvikvm(129): threadid=3: reacting to signal 3
02-13 13:04:24.916: I/dalvikvm(129): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:04:24.916: I/Process(59): Sending signal. PID: 260 SIG: 3
02-13 13:04:24.916: I/dalvikvm(260): threadid=3: reacting to signal 3
02-13 13:04:24.936: I/dalvikvm(260): Wrote stack traces to '/data/anr/traces.txt'
......
02-13 13:04:24.976: I/dalvikvm(197): threadid=3: reacting to signal 3
02-13 13:04:24.996: I/dalvikvm(197): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:04:24.996: I/Process(59): Sending signal. PID: 244 SIG: 3
02-13 13:04:25.007: I/dalvikvm(244): threadid=3: reacting to signal 3
02-13 13:04:25.026: I/dalvikvm(244): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:04:25.036: I/Process(59): Sending signal. PID: 233 SIG: 3
02-13 13:04:25.036: I/dalvikvm(233): threadid=3: reacting to signal 3
02-13 13:04:25.056: I/dalvikvm(233): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:04:25.056: I/Process(59): Sending signal. PID: 251 SIG: 3
02-13 13:04:25.066: I/dalvikvm(251): threadid=3: reacting to signal 3
02-13 13:04:25.086: I/dalvikvm(251): Wrote stack traces to '/data/anr/traces.txt'
02-13 13:04:25.086: I/Process(59): Sending signal. PID: 127 SIG: 3
02-13 13:04:25.096: I/dalvikvm(127): threadid=3: reacting to signal 3
....
02-13 13:04:25.236: I/Process(59): Sending signal. PID: 162 SIG: 3
02-13 13:04:25.236: I/dalvikvm(162): threadid=3: reacting to signal 3
02-13 13:04:25.266: I/dalvikvm(162): Wrote stack traces to '/data/anr/traces.txt'
....
02-13 13:04:25.367: E/ActivityManager(59): ANR in com.wordpress.androiddevgeo.Radiation (com.w...mass_calcs)
02-13 13:04:25.367: E/ActivityManager(59): Reason: keyDispatchingTimedOut
02-13 13:04:25.367: E/ActivityManager(59): Load: 0.34 / 0.5 / 0.36
02-13 13:04:25.367: E/ActivityManager(59): CPU usage from 259522ms to 57ms ago:
02-13 13:04:25.367: E/ActivityManager(59): system_server: 3% = 3% user + 0% kernel / faults: 4845 minor 78 major
02-13 13:04:25.367: E/ActivityManager(59): adbd: 1% = 0% user + 1% kernel / faults: 119 minor
02-13 13:04:25.367: E/ActivityManager(59): d.process.acore: 0% = 0% user + 0% kernel / faults: 2243 minor 77 major
02-13 13:04:25.367: E/ActivityManager(59): id.defcontainer: 0% = 0% user + 0% kernel / faults: 968 minor 2 major
02-13 13:04:25.367: E/ActivityManager(59): ndroid.launcher: 0% = 0% user + 0% kernel / faults: 1341 minor 8 major
02-13 13:04:25.367: E/ActivityManager(59): m.android.phone: 0% = 0% user + 0% kernel / faults: 489 minor
02-13 13:04:25.367: E/ActivityManager(59): ronsoft.openwnn: 0% = 0% user + 0% kerne...
02-13 13:04:25.367: E/ActivityManager(59): rild: 0% = 0% user + 0% kernel / faults: 39 minor
02-13 13:04:25.367: E/ActivityManager(59): ndroid.settings: 0% = 0% user + 0% kernel / faults: 466 minor
02-13 13:04:25.367: E/ActivityManager(59): android.protips: 0% = 0% user + 0% kernel / faults: 394 minor
02-13 13:04:25.367: E/ActivityManager(59): m.android.music: 0% = 0% user + 0% kernel / faults: 395 minor
02-13 13:04:25.367: E/ActivityManager(59): d.process.media: 0% = 0% user + 0% kernel / faults: 398 minor
02-13 13:04:25.367: E/ActivityManager(59): .quicksearchbox: 0% = 0% user + 0% kernel / faults: 407 minor
02-13 13:04:25.367: E/ActivityManager(59): zygote: 0% = 0% user + 0% kernel / faults: 108 minor
02-13 13:04:25.367: E/ActivityManager(59): qemud: 0% = 0% user + 0% kernel / f...kernel / faults: 36 minor
02-13 13:04:25.367: E/ActivityManager(59): +evgeo.Radiation: 0% = 0% user + 0% kernel
02-13 13:04:25.367: E/ActivityManager(59): +sh: 0% = 0% user + 0% kernel
02-13 13:04:25.367: E/ActivityManager(59): +logcat: 0% = 0% user + 0% kernel
02-13 13:04:25.367: E/ActivityManager(59): +evgeo.Radiation: 0% = 0% user + 0% kernel
02-13 13:04:25.367: E/ActivityManager(59): TOTAL: 10% = 6% user + 3% kernel + 0% iowait + 0% irq + 0% softirq
02-13 13:04:25.396: W/WindowManager(59): No focus window, dropping: KeyEvent{action=0 code=4 repeat=0 meta=0 scancode=158 mFlags=8}
D/dalvikvm(59): GC_FOR_MALLOC freed 3845 objects / 289456 bytes in 143ms
D/dalvikvm(59): GC_FOR_MALLOC freed 271 objects / 240072 bytes in 140ms
D/dalvikvm(59): GC_FOR_MALLOC freed 220 objects / 180856 bytes in 133ms
W/ActivityManager(59): Force finishing activity com.wordpress.androiddevgeo.Radiation/.mass_calcs
I/ActivityManager(59): Killing com.wordpress.androiddevgeo.Radiation (pid=327): user's request
I/Process(59): Sending signal. PID: 327 SIG: 9
I/ActivityManager(59): Process com.wordpress.androiddevgeo.Radiation (pid 327) has died.
I/WindowManager(59): WIN DEATH: Window{43fc95b8 com.w...Radiation/com.w...Radiation.Radiation paused=false}
I/WindowManager(59): WIN DEATH: Window{43fd5a38 com.w...Radiation/com.w..Radiation.number_mass paused=false}
I/ActivityManager(59): Start proc com.w...Radiation for activity com....Radiation/.Radiation: pid=337 uid=10043 gids={3003}
D/dalvikvm(33): GC_EXPLICIT freed 283 objects / 10816 bytes in 275ms
D/dalvikvm(33): GC_EXPLICIT freed 47 objects / 2016 bytes in 171ms
D/dalvikvm(33): GC_EXPLICIT freed 2 objects / 64 bytes in 141ms
W/InputManagerService(59): Got RemoteException sending setActive(false) notification to pid 327 uid 10043
I/ActivityManager(59): Displayed activity com.w..o.Radiation/.Radiation: 1409 ms (total 41279 ms)
答案 0 :(得分:1)
您没有设置ArrayList
的大小 - 这基本上是使用ArrayList
的美女之一。这是动态的。不要将它与常规Java数组混淆,您可以在其中定义一定的大小。
答案 1 :(得分:0)
首先,我建议不要制作一个10,000条目ArrayList-这是不必要的。
我不是100%熟悉这个问题,但是如果你只有这么多的数据点,并且用户输入的东西很远,那么为什么不限制用户可以输入的内容呢?如果它不是有效条目,请在Toast消息中告诉它们,并检查输入以使活动不会崩溃。
ttime在LineGraph_mass活动中有什么价值?