You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by "raju.ch" <ra...@gmail.com> on 2012/05/14 09:06:16 UTC

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

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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Martijn Dashorst <ma...@gmail.com>.
Don't use a ListView for showing 70k records. Use a DataView and
IDataProvider combo for that.

Martijn

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Thomas Götz <to...@decoded.de>.
https://cwiki.apache.org/WICKET/detachable-models.html

   -Tom


raju.ch wrote:

> - Can you please provide a sample of LoadableDetachModel?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by "raju.ch" <ra...@gmail.com>.
- Can you please provide a sample of LoadableDetachModel?

--
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-tp4631614p4631794.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Martin Grigorov <mg...@apache.org>.
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 <ra...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by "raju.ch" <ra...@gmail.com>.
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


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

Posted by Martin Grigorov <mg...@apache.org>.
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 <ra...@gmail.com> 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: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>



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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org