loops - Java Virtual Machine stops responding with no known reason -


after exporting project eclipse executable java program, program stops responding randomly. can't find specific event or action causes it. reason can think of happening endless loop 1 have this:

for(int =0;i<pipes.length;i++){     if((powerup.bound.overlaps(pipes[i].bounds)|| (powerup.bound.overlaps(pipes[i].bounds2)))|| (powerup.bound.overlaps(blocks[i].bound))){         powerup.position.y=(float) ((height/4)+((height/2)* (math.random())));         i=0;     } } 

which makes sure powerup doesn't spawn within objects, there plenty of free space them spawn in.

there no other continuous loops in code there other reasons "stopped responding" error?

you need figure out where hang occurring. remember - it's entirely possibly has nothing "for" loop: anywhere.

it's pretty safe bet "hang" application error, not "jvm bug".

suggestions:

  1. execute program in ide debugger (for example, eclipse or android studio) , @ threads/thread stacks when "hang" occurs;

  2. alternatively, step through program in debugger until encounter hang.

  3. write "printf" or "toast" statements before/after "for" loop verify whether or not "hang" occurs inside loop;

  4. run strace, windows process explorer or similar os-level tool see last thing program did before hung.

  5. if have system and/or application logs, sure check them.

i have no idea target environment is. on off chance might android, article might help:

good luck - , please post find!


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -