pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

raju.ch
Hi all,

When loading more than 70000 records pageableListview is giving out of memory exception..Is there a way to avoid this problem?

Please reply back to me as early as possible.
Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

Martin Grigorov-4
Hi,

Options:
1) decrease the number of shown items. 70k is way too much information
for a single page
2) use lighter model objects
3) increase your JVM max memory (-Xmx)

On Mon, May 14, 2012 at 9:06 AM, raju.ch <[hidden email]> wrote:

> Hi all,
>
> When loading more than 70000 records pageableListview is giving out of
> memory exception..Is there a way to avoid this problem?
>
> Please reply back to me as early as possible.
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/pageablelistview-is-giving-out-of-memory-exception-while-loading-more-than-70000-records-wicket-exame-tp4631614.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

raju.ch
Sorry that I didn't give the proper information, actually we are showing 10 records per page and the size of the list is 70000 which we are passing to PageableListview..It seems listview is loading all 70000 items at once..and each request it probably might iterating the List..so I think loading whole list at once is giving the out memory exception below is the code we are using.. Please suggest a solution asap.

PageableListView<UserProfile> userProfileDisplay = new PageableListView<UserProfile>("userProfileDisplay",userProfileDTOsList,10) {
@Override
                                protected void populateItem(ListItem<UserProfile> listItem) {
                                        final UserProfile userProfileModel = listItem.getModelObject();
                                        listItem.add(new Label("userId", userProfileModel.getUserId()));
                                        listItem.add(new Label("userName", userProfileModel.getUserName()));
                                        listItem.add(new Label("appGroup", userProfileModel.getGroupName()));
                                        listItem.add(new Label("createdDate", pattern.format(userProfileModel.getCreatedDate())));
                                        listItem.add(new UserDetailsPanel("userdetails",getUserProfileManager().getUserProfileByUserIdAndGroup(userProfileModel.getUserId(),userProfileModel.getGroupName())));
                                       
                                        final Link<String> editLink = new Link<String>("edit") {
                                               
                                                /**
                                                 *
                                                 */
                                                private static final long serialVersionUID = 5688344743264794845L;
       
                                                @Override
                                                public void onClick() {
                                                       
                                                        UserProfileAddPage userProfilePage = new UserProfileAddPage(userProfileModel,true,userProfileDisplay.getCurrentPage(), null);
                                                        setResponsePage(userProfilePage);
                                                }
                                        };
                                        listItem.add(editLink);

                                        final Link<String> deleteLink = new Link<String>("delete") {
                                               
                                                /**
                                                 *
                                                 */
                                                private static final long serialVersionUID = 5688344743264794845L;
       
                                                @Override
                                                public void onClick() {
// boolean isDeleted = getAppProfileManager().deleteApp(appProfileDTO.getAppId());
// if(isDeleted){
// PageParameters pageParameters = new PageParameters("message=Deleted Successfully");
// setResponsePage(UserProfileDisplayPage.class,pageParameters);
Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

Martin Grigorov-4
Option 4) use constructor: public PageableListView(final String id,
final IModel<? extends List<? extends T>> model,
                int itemsPerPage)

i.e. use a model that loads the needed items on demand. E.g.
LoadableDetachableModel

On Mon, May 14, 2012 at 10:06 AM, raju.ch <[hidden email]> wrote:

> Sorry that I didn't give the proper information, actually we are showing 10
> records per page and the size of the list is 70000 which we are passing to
> PageableListview..It seems listview is loading all 70000 items at once..and
> each request it probably might iterating the List..so I think loading whole
> list at once is giving the out memory exception below is the code we are
> using.. Please suggest a solution asap.
>
> PageableListView<UserProfile> userProfileDisplay = new
> PageableListView<UserProfile>("userProfileDisplay",userProfileDTOsList,10) {
> @Override
>                                protected void populateItem(ListItem<UserProfile> listItem) {
>                                        final UserProfile userProfileModel = listItem.getModelObject();
>                                        listItem.add(new Label("userId", userProfileModel.getUserId()));
>                                        listItem.add(new Label("userName", userProfileModel.getUserName()));
>                                        listItem.add(new Label("appGroup", userProfileModel.getGroupName()));
>                                        listItem.add(new Label("createdDate",
> pattern.format(userProfileModel.getCreatedDate())));
>                                        listItem.add(new
> UserDetailsPanel("userdetails",getUserProfileManager().getUserProfileByUserIdAndGroup(userProfileModel.getUserId(),userProfileModel.getGroupName())));
>
>                                        final Link<String> editLink = new Link<String>("edit") {
>
>                                                /**
>                                                 *
>                                                 */
>                                                private static final long serialVersionUID = 5688344743264794845L;
>
>                                                @Override
>                                                public void onClick() {
>
>                                                        UserProfileAddPage userProfilePage = new
> UserProfileAddPage(userProfileModel,true,userProfileDisplay.getCurrentPage(),
> null);
>                                                        setResponsePage(userProfilePage);
>                                                }
>                                        };
>                                        listItem.add(editLink);
>
>                                        final Link<String> deleteLink = new Link<String>("delete") {
>
>                                                /**
>                                                 *
>                                                 */
>                                                private static final long serialVersionUID = 5688344743264794845L;
>
>                                                @Override
>                                                public void onClick() {
> //                                                      boolean isDeleted =
> getAppProfileManager().deleteApp(appProfileDTO.getAppId());
> //                                                      if(isDeleted){
> //                                                              PageParameters pageParameters = new
> PageParameters("message=Deleted Successfully");
> //                                                              setResponsePage(UserProfileDisplayPage.class,pageParameters);
>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/pageablelistview-is-giving-out-of-memory-exception-while-loading-more-than-70000-records-wicket-exame-tp4631614p4631717.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>



--
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

raju.ch
- Can you please provide a sample of LoadableDetachModel?
Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

Tom Götz
https://cwiki.apache.org/WICKET/detachable-models.html

   -Tom


raju.ch wrote:

> - Can you please provide a sample of LoadableDetachModel?


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

Martijn Dashorst
Administrator
In reply to this post by Martin Grigorov-4
Don't use a ListView for showing 70k records. Use a DataView and
IDataProvider combo for that.

Martijn

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: pageablelistview is giving out of memory exception while loading more than 70000 records wicket example

vnraomca
This post has NOT been accepted by the mailing list yet.
I am getting Out of memory error while querying the database for all records(70k) with hibernate.

Please let me know how to resolve this issue.

Thanks for your support.