java - Garbage Collector taking too much CPU Time -
i've developed web application process huge amount of data , takes lot of time complete?
so doing profiling of application , noticed 1 bad thing gc.
when full gc occurred stops process 30 - 40 secs.
i wonder if there way improve this. don't want waist cpu's time in gc. below details can useful:
- i using java 1.6.0.23
- my application takes 20 gb max memory.
- a full gc occur after every 14 minutes.
- memory before gc 20 gb , after gc 7.8 gb
- memory used in cpu (i.e. shown in task manager) 41 gb.
- after process completed(jvm still running) used memory 5 gb , free memory 15 gb.
the fewer things new
, fewer things need collected.
suppose have class a. can include in reference instance of class a. way can make "free list" of instances of a. whenever need a, pop 1 off free list. if free list empty, new
one.
when no longer need it, push on free list.
this can save lot of time.
Comments
Post a Comment