[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: OutOfMemoryError on event-handling thread

Danail Nachev wrote:

> When you have such huge data sets, it usually better to load only a
> small portion of the dataset and show it instead of loading all of it.
> You can try to use SoftReferences or weakReferences to keep the data.
> This way, when the system needs memory it will remove some of your
> references and free the memory. It seems easier than handling
> OutOfMemory errors.
> 
> Just my .02
> 
> Danail

Yes; in practical terms this would solve my problem.  Unfortunately, I'm
using TableViewer, which doesn't seem to support that approach.  I know
that with SWT.VIRTUAL a TableViewer does lazy loading, but I don't think it
is able to forget items that have already been loaded and then reload them
when they are needed.  I'm also pretty sure it does not have support for
sorting a table without having all of the items loaded into memory.  This
sounds like an interesting thing to implement (once in a lifetime ;-)) but
I doubt I will find the time.

-David