Memory error in development machine

I am getting memory error on development machine (sometime on deployment m/c also) on opening a screen. The screen has a tree view and one browser. The total number of records are 12100 now (It will go upto 50000).

The app.log of development m/c is -

2019-09-04 22:30:21.933 DEBUG [http-nio-8080-exec-42/sheelcompliance-core/admin] com.haulmont.cuba.core.app.RdbmsStore - loadList: metaClass=sheelcompliance_LegalText, view=com.company.sheelcompliance.entity.LegalText/legalText-view, query=select e from sheelcompliance_LegalText e order by e.position
2019-09-04 22:30:31.177 ERROR [http-nio-8080-exec-42/sheelcompliance/admin] com.haulmont.cuba.web.log.AppLog - Exception:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236) ~[na:1.8.0_152]
at java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:191) ~[na:1.8.0_152]
at com.haulmont.cuba.core.sys.serialization.StandardSerialization.serialize(StandardSerialization.java:81) ~[cuba-global-7.0.10.jar:7.0.10]
at com.haulmont.cuba.core.sys.serialization.SerializationSupport.serialize(SerializationSupport.java:61) ~[cuba-global-7.0.10.jar:7.0.10]
at com.haulmont.cuba.core.sys.remoting.LocalServiceInvokerImpl.invoke(LocalServiceInvokerImpl.java:99) ~[na:na]
at com.haulmont.cuba.web.sys.remoting.LocalServiceProxy$LocalServiceInvocationHandler.invoke(LocalServiceProxy.java:154) ~[cuba-web-7.0.10.jar:7.0.10]
at com.sun.proxy.$Proxy40.loadList(Unknown Source) ~[na:na]
at com.haulmont.cuba.client.sys.DataManagerClientImpl.loadList(DataManagerClientImpl.java:57) ~[cuba-client-7.0.10.jar:7.0.10]
at com.haulmont.cuba.gui.model.impl.CollectionLoaderImpl.load(CollectionLoaderImpl.java:88) ~[cuba-gui-7.0.10.jar:7.0.10]
at com.haulmont.cuba.gui.model.impl.ScreenDataImpl.loadAll(ScreenDataImpl.java:79) ~[cuba-gui-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.WebScreens.loadDataBeforeShow(WebScreens.java:542) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.WebScreens.show(WebScreens.java:428) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.WebScreens.showFromNavigation(WebScreens.java:534) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.gui.config.MenuItemCommands$ScreenCommand.run(MenuItemCommands.java:213) ~[cuba-gui-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.MenuBuilder$MenuCommandExecutor.accept(MenuBuilder.java:256) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.MenuBuilder$MenuCommandExecutor.accept(MenuBuilder.java:241) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.gui.components.mainwindow.WebAppMenu$MenuItemImpl.menuSelected(WebAppMenu.java:435) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.gui.components.mainwindow.WebAppMenu$MenuItemImpl$$Lambda$395/296985235.menuSelected(Unknown Source) ~[na:na]
at com.vaadin.ui.MenuBar.changeVariables(MenuBar.java:225) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.changeVariables(ServerRpcHandler.java:611) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:457) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:400) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:260) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:82) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1577) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:425) ~[vaadin-server-8.6.4-17-cuba.jar:8.6.4-17-cuba]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.serviceAppRequest(CubaApplicationServlet.java:329) ~[cuba-web-7.0.10.jar:7.0.10]
at com.haulmont.cuba.web.sys.CubaApplicationServlet.service(CubaApplicationServlet.java:215) ~[cuba-web-7.0.10.jar:7.0.10]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[catalina.jar:9.0.14]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[catalina.jar:9.0.14]
2019-09-04 22:30:31.245 WARN [http-nio-8080-exec-42] com.haulmont.cuba.web.sys.CubaApplicationServlet - Too long request processing [10255 ms]: ip=0:0:0:0:0:0:0:1, url=/sheelcompliance/UIDL/
2019-09-04 22:30:36.307 DEBUG [http-nio-8080-exec-10] com.haulmont.cuba.web.App - Initializing application
2019-09-04 22:30:36.318 DEBUG [http-nio-8080-exec-10/sheelcompliance/anonymous] com.haulmont.cuba.web.DefaultApp - connectionStateChanged connected: true, authenticated: false
2019-09-04 22:30:36.318 DEBUG [http-nio-8080-exec-10/sheelcompliance/anonymous] com.haulmont.cuba.web.App - Closing all windows in all UIs
2019-09-04 22:30:36.331 WARN [http-nio-8080-exec-10/sheelcompliance/anonymous] com.haulmont.cuba.gui.sys.UiControllerDependencyInjector - Unable to find an instance of type ‘class com.company.sheelcompliance.UserSessionExistsException’ named ‘userSessionExistsException’ for instance of ‘com.company.sheelcompliance.web.screens.ExtNexbitAppLoginWindow’

How to solve this issue?
Will app has limitation of number of records?
Is it due to ‘forget paasword’ add-on? (as i have added this add-on recently) or due to more data?

regards

Umesh

Umesh[quote=“umeshhodwala, post:2, topic:10082, full:true”]
New observations -
The problem is due to one of attribute ‘html’ which has large text. If I remove this from view, there is no memory issue)

But I require this data.

I decide to use two collection in for same data. One collection is for tree and second will be filtered based on first collection and will show html in browser component based on clicked item in tree.

I am using this code but it is giving error of ‘current item is null’

@Subscribe(id = “legalTextsDc”, target = Target.DATA_CONTAINER)
private void onLegalTextsDcItemChange(InstanceContainer.ItemChangeEvent event) {
LegalText lt = event.getItem();

// UUID pr = lt.getUuid();
loader1.setParameter(“myParent”, lt);
loader1.load();
//String htm = lt.getHtml()!=null? lt.getHtml():“”;
LegalText tt = legalTextsDc_1.getItem();//loader1.getContainer().getItem();//
//notifications.create(Notifications.NotificationType.ERROR).withCaption(tt.getTitle()).show();

if (tt.getHtml()==null || tt.getHtml().isEmpty()) {
        //do nothing
    } else {
        byte[] bytes = event.getItem().getHtml().getBytes(StandardCharsets.UTF_8);
        browserFrame.setSource(StreamResource.class)
                .setStreamSupplier(() -> new ByteArrayInputStream(bytes))
                .setMimeType("text/html");
    }

    Regulation mr = event.getItem().getRegulation();
    legalUpdatesDl.setParameter("myMaster", mr);
    legalUpdatesDl.load();


}

Unable to identify problem, Is it allowed in cuba?

regards

Umesh
[/quote]

This code solved the issue-

LegalText lt = event.getItem();

    UUID pr = lt.getUuid();
    //notifications.create(Notifications.NotificationType.ERROR).withCaption(pr.toString()).show();
    loader1.setParameter("myParent", pr);
    loader1.load();

    LegalText tt = loader1.getContainer().getItem(pr);