我开了很多个线程爬取网页上的信息,然后将这些信息写入数据库。
但是不管我开启多少个线程,每当写入数据库三万多条记录之后就会报出下面这个异常,请问如何解决呢???
怪我咯2017-04-18 09:35:48
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
怪我咯2017-04-18 09:35:48
Put out the GC detailed log and observe the memory GC situation
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
阿神2017-04-18 09:35:48
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