mysql - java.lang.OutOfMemoryError: GC overhead limit exceede
PHP中文网
PHP中文网 2017-04-18 09:33:48
0
3
823

我开了很多个线程爬取网页上的信息,然后将这些信息写入数据库。
但是不管我开启多少个线程,每当写入数据库三万多条记录之后就会报出下面这个异常,请问如何解决呢???

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
刘奇

Your sql connection is neither reused nor closed...

There is a way to treat the symptoms but not the root cause, which is to increase the memory of the jvm.
Startup parameters Riga-Xms512m-Xmx1024m

刘奇
  1. Put out the GC detailed log and observe the memory GC situation

  2. Dump the memory snapshot at that time and observe which objects occupy the memory

PS: It is estimated that there are large objects. The large objects directly enter the old generation and still hold references to the large objects in the application

阿神

My friends helped me guess the conclusion, you can give it a try

http://www.yl1001.com/group_article/1721468995450102.htm?classic_id=7691469068392318#comment_7691469068392318

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template