Java heap space Problem

Hi friends,
I have a problem with a process and a ui-grid that shows this kind of essues "Java heap space". The problem arrives when in my process I try to import 3000 records of one shot. The process ends with the error in logs:
"SEVERE: org.bonitasoft.web.rest.server.api.resource.CommonResource USERNAME=walter.bates | java.lang.OutOfMemoryError: Java heap space".
I've workaround it importing from 4 little files csv. But when I try to show the records in an ui-grid screen, the grid is empty and same error is showing in logs.