- Removed calls to no more existing clearResources functions (on PDFont
class and its children) since upgrade to pdfbox 2.n.n
- Removed hacky usage of protected internal ClassLoader function. This
removes the warnings displayed when running with JDK9 or JDK10 :
[java] WARNING: Illegal reflective access by
net.yacy.document.parser.pdfParser$ResourceCleaner (file:<path>) to
method java.lang.ClassLoader.findLoadedClass(java.lang.String)
[java] WARNING: Please consider reporting this to the maintainers
of net.yacy.document.parser.pdfParser$ResourceCleaner
[java] WARNING: Use --illegal-access=warn to enable warnings of
further illegal reflective access operations
[java] WARNING: All illegal access operations will be denied in a
future release
Crawling thousands of pdf documents from various sources after
modifications applied, revealed no new memory leak related to pdfbox
(measurements done with JVisualVM).
@ -81,10 +81,6 @@ public class pdfParser extends AbstractParser implements Parser {
this.SUPPORTED_MIME_TYPES.add("text/x-pdf");
}
static{
clean_up_idiotic_PDFParser_font_cache_which_eats_up_tons_of_megabytes();// must be called here to get that into the class loader; it will block other threads otherwise;
}
@Override
publicDocument[]parse(
finalDigestURLlocation,
@ -249,18 +245,9 @@ public class pdfParser extends AbstractParser implements Parser {
try{pdfDoc.close();}catch(finalThrowablee){}
}
// clear resources in pdfbox. they say that is resolved but it's not. see:
@ -2454,7 +2454,7 @@ public final class Switchboard extends serverSwitch {
publicstaticvoidclearCaches(){
// flush caches in used libraries
pdfParser.clean_up_idiotic_PDFParser_font_cache_which_eats_up_tons_of_megabytes();// eats up megabytes, see http://markmail.org/thread/quk5odee4hbsauhu