I am trying to obtain list of notes for my web app. I am using NoteStoreClient to obtain list on Notebooks then list of notes for every found notebook.

Here is my method constucting the client (actually the client wrapper, but that is just implementation details):

```
private DatesAwareNoteStoreClient fromAccessToken(EvernoteAccount evernoteAccount) throws TException, EDAMUserException, EDAMSystemException {
    // Set up the UserStore client and check that we can speak to the server
    synchronized (this) {
        EvernoteAuth evernoteAuth = new EvernoteAuth(EvernoteService.SANDBOX, evernoteAccount.getAccessToken());
        evernoteAuth.setNoteStoreUrl(evernoteAccount.getNoteStoreUrl());

        com.evernote.clients.ClientFactory factory = new com.evernote.clients.ClientFactory(evernoteAuth);

        // Set up the NoteStore client
        return new DatesAwareNoteStoreClient(factory.createNoteStoreClient());
    }
}

```

All works fine, I'm getting access token before, constructing of NoteStoreClient goes succesfully. But when I'm calling listNotebooks() I get very odd for me error:

```
[INFO] [talledLocalContainer] Exception in thread "http-bio-2990-exec-11" java.lang.OutOfMemoryError: Java heap space
[INFO] [talledLocalContainer]   at com.evernote.thrift.protocol.TBinaryProtocol.readStringBody(TBinaryProtocol.java:388)
[INFO] [talledLocalContainer]   at com.evernote.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:236)
[INFO] [talledLocalContainer]   at com.evernote.edam.notestore.NoteStore$Client.recv_listNotebooks(NoteStore.java:337)
[INFO] [talledLocalContainer]   at com.evernote.edam.notestore.NoteStore$Client.listNotebooks(NoteStore.java:322)
[INFO] [talledLocalContainer]   at com.evernote.clients.NoteStoreClient.listNotebooks(NoteStoreClient.java:173)
[INFO] [talledLocalContainer]   at com.room606.jira.activenotes.evernote.EvernoteManager.listNotesByQuery(EvernoteManager.java:130)
[INFO] [talledLocalContainer]   at com.room606.jira.activenotes.evernote.EvernoteManager.listNotes(EvernoteManager.java:117)
[INFO] [talledLocalContainer]   at com.room606.jira.activenotes.action.StartReindexAction.doReindex(StartReindexAction.java:79)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] [talledLocalContainer]   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO] [talledLocalContainer]   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO] [talledLocalContainer]   at java.lang.reflect.Method.invoke(Method.java:597)
[INFO] [talledLocalContainer]   at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
[INFO] [talledLocalContainer]   at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
[INFO] [talledLocalContainer]   at webwork.action.ActionSupport.invokeCommand(ActionSupport.java:438)
[INFO] [talledLocalContainer]   at webwork.action.ActionSupport.execute(ActionSupport.java:157)
[INFO] [talledLocalContainer]   at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:87)
[INFO] [talledLocalContainer]   at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:39)
[INFO] [talledLocalContainer]   at webwork.interceptor.NestedInterceptorChain.proceed(NestedInterceptorChain.java:31)
[INFO] [talledLocalContainer]   at webwork.interceptor.ChainedInterceptor.intercept(ChainedInterceptor.java:16)
[INFO] [talledLocalContainer]   at webwork.interceptor.DefaultInterceptorChain.proceed(DefaultInterceptorChain.java:35)
[INFO] [talledLocalContainer]   at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:225)
[INFO] [talledLocalContainer]   at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:154)
[INFO] [talledLocalContainer]   at com.atlassian.jira.web.dispatcher.JiraWebworkActionDispatcher.service(JiraWebworkActionDispatcher.java:152)
[INFO] [talledLocalContainer]   at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[INFO] [talledLocalContainer]   at com.atlassian.jira.web.filters.steps.ChainedFilterStepRunner.doFilter(ChainedFilterStepRunner.java:87)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
[INFO] [talledLocalContainer]   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
[INFO] [talledLocalContainer]   at com.atlassian.jira.web.filters.XContentTypeOptionsNoSniffFilter.doFilter(XContentTypeOptionsNoSniffFilter.java:22)
[INFO] [talledLocalContainer]   at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)

```

Here is my method causing original exception from stacktrace:

```
private Map<Notebook, List<NoteEntry>> listNotesByQuery(String filterQuery) throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    // First, get a list of all notebooks
    List<Notebook> notebooks = datesAwareNoteStoreClient.getClient().listNotebooks();

    Map<Notebook, List<NoteEntry>> noteEntriesMap = new HashMap<Notebook, List<NoteEntry>>();
    for (Notebook notebook : notebooks) {
        System.out.println("Notebook: " + notebook.getName());
        NoteFilter filter = new NoteFilter();
        if (!StringUtils.isEmpty(filterQuery)) {
            filter.setWords(filterQuery);
        }
        filter.setNotebookGuid(notebook.getGuid());

        filter.setOrder(NoteSortOrder.CREATED.getValue());
        filter.setAscending(true);

        NoteList noteList = datesAwareNoteStoreClient.getClient().findNotes(filter, 0, 100);
        List<Note> notes = noteList.getNotes();
        noteEntriesMap.put(notebook, convertToNoteEntries(notebook.getName(), notes));
    }
    latestUpdateDate = new Date();

    return noteEntriesMap;
}

```

This line causes an error:

```
    // First, get a list of all notebooks
    List<Notebook> notebooks = datesAwareNoteStoreClient.getClient().listNotebooks();

```

What goes wrong and what am I missing in my obtan notes process? Thanks in advance!

I'm using Java JDK 1.6\_045, Windows 7 x64, Evernote Java API version 2.5.1.