我正面临着PDFBOX的一个大问题:我试图加载一个10Mb的文件(test.pdf),我需要400 Mb来加载它在JVM上: 这是代码示例:
final File mainFile = new File(
"C:/test.pdf");
System.out.println("File size: " + mainFile.length());
try {
PDDocument doc = PDDocument.load(mainFile);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
System.out.println("Used Memory: " + (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()));
}
这是正常的吗?