mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Mass_parse: Fix memory leak / slow performance due to over-zealous page caching
This commit is contained in:
@@ -18,11 +18,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
package gplx.xowa.xtns.proofreadPage; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*;
|
||||
import org.junit.*; import gplx.xowa.apps.cfgs.*;
|
||||
public class Pp_pages_nde_hdr_tst {
|
||||
private final Xop_fxt fxt = new Xop_fxt();
|
||||
private final Xop_fxt fxt = new Xop_fxt();
|
||||
@Before public void Init() {
|
||||
Io_mgr.Instance.InitEngine_mem();
|
||||
fxt.Wiki().Xtn_mgr().Xtn_proofread().Enabled_y_();
|
||||
fxt.Wiki().Cache_mgr().Page_cache().Free_mem_all();
|
||||
fxt.Wiki().Cache_mgr().Page_cache().Free_mem(true);
|
||||
fxt.Wiki().Db_mgr().Load_mgr().Clear(); // must clear; otherwise fails b/c files get deleted, but wiki.data_mgr caches the Xowd_regy_mgr (the .reg file) in memory;
|
||||
fxt.Wiki().Ns_mgr().Add_new(Xowc_xtn_pages.Ns_page_id_default, "Page").Add_new(Xowc_xtn_pages.Ns_index_id_default, "Index").Init();
|
||||
fxt.Init_page_create("MediaWiki:Proofreadpage_header_template", String_.Concat
|
||||
|
||||
@@ -87,7 +87,7 @@ public class Scrib_lib_title_tst {
|
||||
@Test public void GetContent() {
|
||||
fxt.Test__proc__objs__flat(lib, Scrib_lib_title.Invk_getContent, Object_.Ary("A") , Scrib_invoke_func_fxt.Null_rslt);
|
||||
|
||||
fxt.Parser_fxt().Ctx().Wiki().Cache_mgr().Page_cache().Free_mem_all();
|
||||
fxt.Parser_fxt().Ctx().Wiki().Cache_mgr().Page_cache().Free_mem(true);
|
||||
fxt.Parser_fxt().Init_page_create("A", "test");
|
||||
fxt.Test__proc__objs__flat(lib, Scrib_lib_title.Invk_getContent, Object_.Ary("A") , "test");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user