内存泄漏,内存不足
while (str_html.indexOf("<td class=\"blacktext pL5_pT4_pB4_pR4\" colspan=\"1\">",podidxend) != -1) {
String sgindate = null;
String poddate = null;
String podtime = null;
String podplace =null;
String status = null;
String podreason = null;
podidx = str_html.indexOf("<td class=\"blacktext pL5_pT4_pB4_pR4\" colspan=\"1\">",podidxend);
podidxend = str_html.indexOf("</td>", podidx);
sgindate = str_html.substring(podidx + 50, podidxend).trim();
System.out.println(sgindate);
if (Character.isDigit(sgindate.charAt(0))) { // 如果不是乱码
//poddate=sgindate.substring(0,10);
poddate = "07/01/2009";
podtime = "12:03 am";
//podtime = sgindate.substring(sgindate.length() - 8);
/*if (!Character.isDigit(poddate.charAt(9))) { // 如果是乱码
poddate = poddate.substring(0,9);
System.out.println(poddate);
if (!Character.isDigit(poddate.charAt(8))) {// 如果是乱码
poddate = poddate.substring(0,8);
}
}*/
} else {
poddate = "07/01/2009";
podtime = "12:03 am";
//podtime = sgindate.substring(sgindate.length() - 8);
}
/*if (!Character.isDigit(podtime.charAt(0))) {
podtime = podtime.substring(1);
}*/
podidx = str_html.indexOf("colspan=\"2\">", podidxend);
podidxend = str_html.indexOf("<img src=", podidx);
podreason = str_html.substring(podidx + 12, podidxend)
.trim();
podreason = podreason.substring(0, podreason.length() - 1);
if (podreason
.indexOf("<font class=\"txtContentRedSm\">", 0) != -1) {
int a = podreason.indexOf(
"<font class=\"txtContentRedSm\">", 0);
int j = podreason.indexOf("</font>", 0);
podreason = podreason.substring(a + 30, j).trim();
}
podidx = str_html.indexOf("colspan=\"3\">", podidxend);
podidxend = str_html.indexOf("</td>", podidx);
podplace = str_html.substring(podidx + 12, podidxend)
.trim();
if (podplace.indexOf("<img", 0) != -1) {
int b1 = podplace.indexOf("<img", 0);
podplace = podplace.substring(0, b1).trim();
}
podreason = HtmlReplace.Replace(podreason, "'", "''");
podplace = HtmlReplace.Replace(podplace, "'", "''");
sgindate = (new StringBuilder(String.valueOf(poddate)))
.append(" ").append(podtime).toString();
System.out.println(sgindate);
status = "DPR";
if (podreason.equals("Shipment delivered")
|| podreason
.equals("Delivered to broker as requested")
|| podreason
.equals("Delivery arranged, no signature is expected"))
status = "YES";
else
status = "DPR";
track = new String[9];
track[0] = hawb_no1;
track[1] = status;
track[2] = dc.Convert(sgindate, "MM/dd/yyyy hh:mm a",
Locale.ENGLISH, "yyyy-MM-dd HH:mm", Locale.ENGLISH);
track[3] = "";
track[4] = podreason;
track[5] = podplace;
track[6] = cpcode;
track[7] = awb_id;
Qtrack.add(track);
}
}