Is this the same scenario as Teiid is throwing java.lang.OutOfMemoryError while loading maximum data. ?
> It appears the memory is not getting released.
There are several memory regions for Teiid. There is a fixed byte buffer region that once allocated will not be garbage collected - Memory Management · GitBook You should expect that to not be released.
> We haven't explicity enabled any resultset caching and set the default Teiid buffer settings.
Additional on heap memory usage from query processing or caching is either paged to disk as needed or released when the query is finished.
> After we encountered this error, we have played with Teiid buffer sizes like max reserve kb and max memory buffer, but haven't seen much luck .
Yes, you'll need to fully understand what is happening before trying to alter the configuration.
> Attached HeapDump screenshot after I forced GC, I can share the HeapDump if required
The best would be a similar screenshot at the time the gc error occurs - using the HeapDumpOnOutOfMemoryError option.
>> Is this the same scenario as Teiid is throwing java.lang.OutOfMemoryError while loading maximum data. ?
The request seems similar. We also have large source tables with millions of records, though we are only interested in reads
I got the heap dumps . It appears the BufferManagerImpl is holding 18GB in heap. All our Teiid buffer manager settings are set to default. with our JVM heap at 24 GB and machine (32GB).
What version are you using? It looks like the memory being held is on heap storage of batches which should be related to the current query that is processing - that definitely is not expected as memory pressure should force stuff to disk.
We are using Teiid 9.1.1. Is there any known issues with this version?.
The observation we have seen is, after the query gets completed, the memory is not released. On executing a second view, the memory is accumulated.
Yes it's quite possible that you are hitting an issue that has already been addressed. Can you redo your scenario on a later version? If there is an issue that requires a code fix for the community releases that will only be applied to 12.x.
I may not be able to validate with latest version of Teiid immediately. Since we had left the Teiid buffer settings unchanged at default, will changing any of the parameters restrict the usage of Teiid memory buffer?.
You mentioned, There is a fixed byte buffer region that once allocated will not be garbage collected. Is this memory-buffer-space?. Curious to know, What is being held in fixed buffer space that can't be garbage collected? How is memory-buffer-space different from max reserve kb?.
> Since we had left the Teiid buffer settings unchanged at default, will changing any of the parameters restrict the usage of Teiid memory buffer?
The closest would be the max reserve kb setting, see below for more.
> You mentioned, There is a fixed byte buffer region that once allocated will not be garbage collected. Is this memory-buffer-space?
> Curious to know, What is being held in fixed buffer space that can't be garbage collected?
They are large bytebuffers that would frequently be reallocated if they were allowed to be garbage collected. They can also be allocated off heap as well.
However the fixed region is not your issue as it's live on heap batches that are being held in your memory snapshot above.
> How is memory-buffer-space different from max reserve kb?.
max reserve kb refers to approximately how much on heap memory in the form of live batches can be held by the buffer manager. You may try manually setting it - even to just a 0 value to determine if your scenario will then succeed. See Memory Management · GitBook - which has updated property names, or an older version Memory Management · GitBook for more. The section called Common Configuration Scenarios at the end discusses restricting heap usage.
After more analysis, we noticed that this behavior occurs when there is a DISTINCT clause in the federated view.
The federated view has joins from tables from 3 or 4 different data sources.
Do you know of any issue with processing DISTINCT?
> Do you know of any issue with processing DISTINCT?
None specifically. If Teiid processes a distinct operation, it can be quite expensive for large data sets. There have been several refinements since 9.1.1 in memory management and multi-pass sorts.