-
1. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
shawkins Jul 30, 2019 7:31 PM (in response to vishnusv)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.
-
2. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
vishnusv Aug 1, 2019 1:24 PM (in response to shawkins)Steven,
>> 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).
-
3. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
shawkins Aug 1, 2019 3:42 PM (in response to vishnusv)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.
-
4. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
vishnusv Aug 1, 2019 3:50 PM (in response to shawkins)Steven,
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.
-
5. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
shawkins Aug 1, 2019 4:07 PM (in response to vishnusv)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.
-
6. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
vishnusv Aug 1, 2019 5:49 PM (in response to vishnusv)Steven,
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?.
Thanks,
Vishnu
-
7. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
shawkins Aug 1, 2019 10:41 PM (in response to vishnusv)> 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?
Yes.
> 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.
-
8. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
skethire Aug 20, 2019 2:10 PM (in response to shawkins)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?
-
9. Re: Teiid queries not never releasing the memory from heap resulting Garbage collection failures
shawkins Aug 21, 2019 8:17 AM (in response to skethire)> 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.