java - How to limit HtmlUnit's history size? -


I am using HtmlUnit for a parsing job and I have found that memory is wasted with webclients In which there is history every WebWindow I do not use history altogether and I want to disable its management or want to reduce the size of at least 1 or 2. Is this possible?

I'm using the following thing

  try {history Window = getWebWindows (). Get (0) GetHistory (); Field F = window.getClass (). GetDeclaredField ("Undiscovered NewPages_"); // NoSuchFieldException f.setAccessible (true); ((Threadlocal & lt; boolean & gt;) f.get (window)). Set (true); } Hold (exception e) {e.printStackTrace (); The new antitrust error ("Can not disable history"); }  

Comments