javax.servlet.ServletException: java.lang.OutOfMemoryError: Java heap space

my code 1

         FreeformQuery q1= new FreeformQuery("select * from book_copy1 ", connectionPool);
       myContainer = new SQLContainer(q1);                 ( book_copy1       conut  50 ten thousand)
table .setContainerDataSource(myContainer);    
              result 》》》[color=#e85050]

java.lang.OutOfMemoryError: Java heap space
[/color]

my code 2
TableQuery q2= new TableQuery(“book_copy1”, connectionPool);
myContainer = new SQLContainer(q2);
table .setContainerDataSource(myContainer);

             result   is normal!!

          But         in   book of vaadin  。。。(whereas FreeformQuery allows the developer to use their own, 

probably more complex query for fetching data and their own optional implementations for writing,
filtering and sorting
support - item and property handling as well as lazy loading
will still be handled automatically.

Other , how can I use the function for database as postgresql in TableQuery of vaadin ??

Oh,I find

While this looks just as easy as with the TableQuery,
do note that there are some important caveats here.
Using FreeformQuery like this (without providing FreeformQueryDelegate
or FreeformStatementDelegate implementation)
it can only be used as a read-only window to the resultset of the query.
Additionally filtering, sorting
and lazy loading features will not be supported
,