コンピューターで 100 以上のデータを使用して Eclipse をインポートしましたが、問題はありません。しかし、アプリケーション サーバーにデプロイするとメモリ不足になり、ローカルの tomcat をコピーします。
この問題は何ですか?</p>
別の関数では、これより数百万を超える日付と、数フィールド未満の日付。正常にエクスポートできます。
int totalSize = behaviorPortraitService.querySiletUserPortraitCountMonth(sietUserPortraitForm.getParams());
int pageNum = 0;
if (totalSize % 1000000 == 0) {
pageNum = totalSize / 1000000;
}else{
pageNum = totalSize / 1000000 + 1;
}
write.append(" year/month IMSI phone number The date of open card"
+ enter);
outSTr = response.getOutputStream(); // establish
buff = new BufferedOutputStream(outSTr);
// Loop total number of pages,Get the number of pages per page
for (int i = 1; i <= pageNum; i++) {
// According to the number of pages to get PageResult object
list = behaviorPortraitService.exportSiletUserPortraitMonth(sietUserPortraitForm.getParams(),i,100000);
// circulate List collection to write
for (int j = 0; j < list.size(); j++) {
// Recycling collection,Write data to the TXT
write.append(list.get(j).getBegin_endtime());
write.append(" " + list.get(j).getImsi());
write.append(" " + list.get(j).getMsisdn());
write.append(" "+ list.get(j).getSilencedays());
write.append(" " + list.get(j).getStarttime()
+ enter);
}
// After writing a page object,empty List,wipe cache
list.clear();
System.gc();
}
buff.write(write.toString().getBytes("UTF-8"));
エラー:
org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.OutOfMemoryError: Java heap space
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:839)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.trajectory.manager.controller.filter.SessionPrivaligeFilter.doFilter(SessionPrivaligeFilter.java:79)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
root cause
java.lang.OutOfMemoryError: Java heap space
java.lang.StringCoding$StringEncoder.encode(StringCoding.java:232)
java.lang.StringCoding.encode(StringCoding.java:272)
java.lang.String.getBytes(String.java:946)
com.trajectory.behaviorportrait.controller.ExportSiletUserPortraitController.writeWeekTxtWeek(ExportSiletUserPortraitController.java:209)
com.trajectory.behaviorportrait.controller.ExportSiletUserPortraitController.handleRequestInternal(ExportSiletUserPortraitController.java:69)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
com.trajectory.manager.controller.filter.SessionPrivaligeFilter.doFilter(SessionPrivaligeFilter.java:79)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)