Monday, March 3, 2014
About the android GC cycle print GC_CONCURRENT
Recently wrote a Bluetooth communication program, which has a loop to read in one thread, but every time I enter the thread will print 05-27 09:40:36.488: D / dalvikvm (4917): GC_CONCURRENT freed 452K, 20 % free 7408K/9159K, paused 2ms +2 ms
, Probably the code below:
FileInputStream fis = new FileInputStream (mFd.getFileDescriptor ());
FileOutputStream fio = new FileOutputStream (mFd.getFileDescriptor ());
byte data [] = new byte [1024];
int readLength = 0;
int apduType = 0, configid = 0, invokeid = 0, choiceType = 0, eventtype = 0; / / I have tried all the possible variables are defined outside of the while loop. . . .
while (! Thread.currentThread (). isInterrupted ()) {
readLength = fis.read (data, 0,1024); / / This is a statement on TM, removed after printing without GC, and certainly that it caused it. . .
/ / And there are some content, but I'll have to print them masked
GC_CONCURRENT's successor}
After the thread exits, print automatically disappear. . . , I do not know whether this situation is normal, a simple read function Why would cause frequent GC reclaim memory? ? ? ?
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
CSDN master clouds, hope science, online learned a lot, and some say that is normal, but some is due to a memory leak, and I always think this is a bit unusual, well, first home from work. . .
Reply:
Jacking ah. . . . .
Reply:
I also appeared in this case
Reply:
About the circulation print GC_CONCURRENT problems did you solve? Urgent,
Reply:
I played this Android systemservice init2 stage, the same phenomenon appeared suddenly, and then get up ...... look forward master of science, there is a good direction to solve ah! !
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment