performance - java full gc taking too long -


i have java client consumes large amount of data server. if client not keep data stream @ fast enough rate, server disconnects socket connection. client gets disconnected few times per day. ran jconsole see memory usage, , heap space graph looks defined sawtooth pattern, oscillating between 0.5gb , 1.8gb (2gb of heap space allocated). every time disconnected during full gc (but not on every full gc). see full gc takes bit on 1 second on average. depending on time of day, full gc happens every 5 minutes when busy, or 30 minutes can go in between full gcs during slow periods.

i suspect if can reduce full gc time, client able better keep incoming data, not have experience gc tuning. have insight on if might idea, , how it? or there alternative idea may work well?

** update ** used -xx:+useconcmarksweepgc , improved, still got disconnected during busy moments. increased heap allocation 3gb weather through busy moments , seems chugging along pretty now, it's been 1 day without disconnection. maybe if time go through , try reduce amount of garbage created i'm confident well. suggestions.

full gc take long complete, , not easy tune.

one way (easily) tune increase heap space - speaking, double heap space can double interval between 2 gcs, double time consumed gc. if program running has clear usage patterns, maybe can consider increase heap space make interval large can guarantee have idle time try make system perform gc. on other hand, following logic, if heap small full garbage collection finish in instant, seems inviting more troubles helping.

also, -xx:+useconcmarksweepgc might since try perform gc operations concurrently (not stopping program; see here).

here's nice talk til gene (cto of azul systems, maker of high performance jvm, , published several gc algos), gc in jvm in general.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -