hyperscan-java icon indicating copy to clipboard operation
hyperscan-java copied to clipboard

Memory leak in the PatternFilter

Open trpjxrdf opened this issue 3 years ago • 1 comments

Memory used by the PatternFilter is never freed. This code leads to infinite memory consumption.

public static void main(String[] args) throws Exception {
	List<Pattern> regExpPatterns = new ArrayList<Pattern>();
	regExpPatterns.add(Pattern.compile("(d[0-9]d[0-9]d[0-9]d[0-9]),(dcba),(a[0-9]b[0-9]c[0-9]d[0-9]),(dcba: [0-9]00[0-9])"));		
	regExpPatterns.add(Pattern.compile("(a:b:c:d),(1:2:3:4),([0-9]:[0-9]:[0-9]:[0-9]:[0-9]:[0-9]:[0-9]:[0-9])"));		
	regExpPatterns.add(Pattern.compile("[0-9][0-9][0-9][0-9] [0-9][0-9][0-9][0-9][0-9][0-9]"));
	while(true) {
		PatternFilter pf = new PatternFilter(regExpPatterns);
		pf.close();
	}
}

trpjxrdf avatar Jan 11 '22 11:01 trpjxrdf

I run this snippet on windows 10, memory leak not found image

xishian avatar Mar 10 '22 03:03 xishian

Can you please provide some code sample to reproduce this issue and provide more details about the environment? Can you reproduce this issue in the latest release?

gliwka avatar Dec 02 '23 22:12 gliwka