Java??????????????
???????????? ???????[ 2016/3/3 10:55:54 ] ??????????????? ???
??????????????????Java????????????????????????????棬???ò???????й????????????Java???C++??????????????????C++????????????????????й?????????????Java??JVM?????????????????????????????棬?????????2??????java??????????????????????????й???????????C++С???????????????д????????????????????????????????????????????????????????????????????????????
????????????????GC????ι?????:????????????????????????????????????á??????á??????????????????????????????(GC???????????????????)?????Java?????????????GC?????????????????JVM???????????????????????????????????????????GC??????????????????????????????????????????е???????????????????????????Ч?????GC???????????????????????????????????Ч???
????????????Java???????????????????????????Java???????Java??ó?????????????ó????????????????????????????????????????С???????????????????????????????????????????????????????GC?????????GC?????????
???????????????????????????????????
????Xms
???????Heap??С
????Xmx
????java heap???
????Xmn
????young generation??heap??С
????Xss
????????????Stack??С
???????????????????????????????Щ??
????XX:MinHeapFreeRatio=40
????Minimum percentage of heap free after GC to avoid expansion.
????XX:MaxHeapFreeRatio=70
????Maximum percentage of heap free after GC to avoid shrinking.
????XX:NewRatio=2
????Ratio of new/old generation sizes. [Sparc -client:8; x86 -server:8; x86 -client:12.]-client:8 (1.3.1+)?? x86:12]
????XX:NewSize=2.125m
????Default size of new generation (in bytes) [5.0 and newer: 64 bit VMs are scaled 30% larger; x86:1m; x86?? 5.0 and older: 640k]
????XX:MaxNewSize=
????Maximum size of new generation (in bytes). Since 1.4?? MaxNewSize is computed as a function of NewRatio.
????XX:SurvivorRatio=25
????Ratio of eden/survivor space size [Solaris amd64: 6; Sparc in 1.3.1: 25; other Solaris platforms in 5.0 and earlier: 32]
????XX:PermSize=
????Initial size of permanent generation
????XX:MaxPermSize=64m
????Size of the Permanent Generation. [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.]
????????????????????????????????????????????????????????????????????ο??????в???????????лл??
????1.???????????????????(XX = null;)
????????δ???
????public List<PageData> parse(HtmlPage page) {
????List<PageData> list = null;
????try {
????List valueList = page.getByXPath(config.getContentXpath());
????if (valueList == null || valueList.isEmpty()) {
????return list;
????}
????//??????????????????棬???Ч??
????list = new ArrayList<PageData>();
????PageData pageData = new PageData();
????StringBuilder value = new StringBuilder();
????for (int i = 0; i < valueList.size(); i++) {
????HtmlElement content = (HtmlElement) valueList.get(i);
????DomNodeList<HtmlElement> imgs = content.getElementsByTagName("img");
????if (imgs != null && !imgs.isEmpty()) {
????for (HtmlElement img : imgs) {
????try {
????HtmlImage image = (HtmlImage) img;
????String path = image.getSrcAttribute();
????String format = path.substring(path.lastIndexOf(".")?? path.length());
????String localPath = "D:/images/" + MD5Helper.md5(path).replace("\"?? "??").replace("/"?? "??") + format;
????File localFile = new File(localPath);
????if (!localFile.exists()) {
????localFile.createNewFile();
????image.saveAs(localFile);
????}
????image.setAttribute("src"?? "file:///" + localPath);
????localFile = null;
????image = null;
????img = null;
????} catch (Exception e) {
????}
????}
????//????????????????????????????????????????????GC???????????????
????imgs = null;
????}
????String text = content.asXml();
????value.append(text).append("<br/>");
????valueList=null;
????content = null;
????text = null;
????}
????pageData.setContent(value.toString());
????pageData.setCharset(page.getPageEncoding());
????list.add(pageData);
????//???? pageData=null; ??????????list??????и??????????GC?????????
????value=null;
????//???????? list=null; ???list????????????????????÷????е?????????????????????????????????????
????} catch (Exception e) {
????}
????return list;
????}
????2.??????ü?????????????????飬?????????????????????Щ???????GC?????????????
????3.????????????????????ò?????????????????????????????
????4.??????????????????????д??????????????????????????????????????????????????????????
????5.?????????????????????????????????????????????????
????6.??????????????????????????????????????????????????????????????????????
????7.????????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11