apollo-kotlin
apollo-kotlin copied to clipboard
Out of Memory Error during code gen
Version
4.1.1
Summary
Hi team,
We've been getting OOM errors after migrating to 4.1.1. The error message points to metadata file. We have 12K types. If we add opposite link to schema for optimization it might help with this, but we publish the full schema intentionally to consume in other repositories. And we don't want to keep increasing the memory.
We also noticed generateApolloIrOperations task takes long time to run from time to tim. I don't have much data on this yet, just posting here in case they might be related.
Thanks!
Steps to reproduce the behavior
No response
Logs
Execution failed for task *
> java.lang.OutOfMemoryError: GC overhead limit exceeded at $.commonMetadata.schema
Thanks for reporting. Could you share the full stack trace?
Also would it possible to share your schema and operations (can be done privately at [email protected])? That would help us reproduce and investigate the issue. Thanks!
Hey Benoit, I replied to this but looks like I forgot to submit the comment.
Anyway, in the logs there is nothing other than task runs. The only thing I omitted is the generateApolloSources task name.
For generateApolloIrOperations I created https://github.com/apollographql/apollo-kotlin/issues/6451 which you already saw.
I will get the schema and operations to you for both of this issues. Thanks
Update: we received the schema/operations, thank you for that - and looking into it.
Would it be possible for you to test the new cache (needs Apollo Kotlin 4.3)?
With it, we no longer make the check for missing key fields in all possible types, which we suspect was the source of a lot of computation.
Hi @GokhanArik 👋🏻 just wondering if you saw @BoD's message above? The new cache may resolve your issue, let us know 🙏🏻