一次线上 tomcat jvm内存崩溃的问题

@RequestMapping("syncProxyInfo")
	public ReturnValue syncAgentInfo(HttpServletRequest request) {
		long start=new Date().getTime();
		try {
			JSONObject jsonObject=CoreUtil.getBodyJSONObj(request);
			JSONArray jsonArray=jsonObject.getJSONArray("data");
			logger.info("proxysize:"+jsonArray.size());
			logger.info(jsonArray.toJSONString());
			if(jsonArray!=null&&!jsonArray.isEmpty()) {
				//解析数据
				List dataList=JSONArray.toJavaObject(jsonArray, List.class);
				int size=dataList.size();
				int copies=getCopies(size);
				copies=copies>100?100:copies;//最大100个线程
				ExecutorService esS=Executors.newFixedThreadPool(copies);
				//将大数据拆分成几个小数据然后通过线程池同步并行执行.
				List<List<List<String>>> result=Lists.partition(dataList, MAX_EACH_COUNT);
				result.forEach(lists->{
					esS.submit(()->{
						analysisData(lists);
					});
				});
				esS.shutdown();
				while(true) {
					if(esS.isTerminated()) {
						long end=new Date().getTime();//263995
						logger.info("用时"+(end-start)/1000+"秒");
						return new ReturnValue(true);
					}
				}
			}
		}catch(Exception e) {
			logger.error(e.getMessage());
			return new ReturnValue(false,e.getMessage());
		}
		return new ReturnValue(false);
	}

调用该接口 导致tomcat jvm 崩溃了
这个接口有两千条数据,每条数据需要查林外一个接口

异常日志不知道咋分析,为什么会有2000对个线程阻塞住了

There is insufficient memory for the Java Runtime Environment to continue.

Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate

Possible reasons:

The system is out of physical RAM or swap space

In 32 bit mode, the process size limit was hit

Possible solutions:

Reduce memory load on the system

Increase physical memory or swap space

Check if swap backing store is full

Use 64 bit Java on a 64 bit OS

Decrease Java heap size (-Xmx/-Xms)

Decrease number of Java threads

Decrease Java thread stack sizes (-Xss)

Set larger code cache with -XX:ReservedCodeCacheSize=

This output file may be truncated or incomplete.

Out of Memory Error (allocation.cpp:272), pid=25734, tid=0x88f40b70

JRE version: Java™ SE Runtime Environment (8.0_221-b11) (build 1.8.0_221-b11)

Java VM: Java HotSpot™ Client VM (25.221-b11 mixed mode linux-x86 )

Failed to write core dump. Core dumps have been disabled. To enable core dumping, try “ulimit -c unlimited” before starting Java again

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值