Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Vaadin 7 + Hibernate 4 + Spring 3: 2nd Factor

Kira Lee
7 years ago Mar 24, 2016 3:42pm
Alejandro Duarte
6 years ago Mar 31, 2016 2:00pm


There are many factors that could cause an OutOfMemoryError. It could be too many concurrent users for your server capabilities, Hibernate queries that end up returning the whole (or almost the whole) database, or loading not-too-big datasets way too many times. In the end your code is trying to allocate memory that cannot fit into the heap.

Because with Vaadin you write web applications using only Java, sometimes it's easy to forget that you are developing a web application that keeps each user's UI state in memory. You should avoid loading big data sets and bind them to a Grid, for example. Instead use some kind of lazy-loading mechanism to retrieve data as needed.

I would suggest you investigate at which point in your code your application throws this error by inspecting the stack trace or using a tool such as VisualVM.

Kira Lee
6 years ago Apr 18, 2016 3:04pm