There are several considerations here.
The first is that since the Teiid metadata is held in memory, then there will be a base memory footprint given the names used in your metadata. Teiid does attempt to minimize this footprint by breaking the names down (fqns are not held in memory) and then attempts to use canonical strings. If you are using a lot of models and/or vdb versions that have redundant names there is additional canonicalization Teiid could be doing post metadata deserialization that would help reduce the base memory footprint. A general recomendation is to undeploy any unused old vdbs.
The next consideration is that the parsed form of queries can retain some of the original source string. This is due to code that is shared with Teiid Designer (which wants to retain the user sql as much as possible) that should be better disabled at runtime.
The last consideration is that original sql strings or parsed substrings (from above) can be held in memory in cache keys or prepared plans which has a longer lifespan in memory than just the in-flight query.
Hope this helps,