apollo-kotlin icon indicating copy to clipboard operation
apollo-kotlin copied to clipboard

Out of Memory Error during code gen

Open GokhanArik opened this issue 7 months ago • 5 comments
trafficstars

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

GokhanArik avatar Apr 02 '25 22:04 GokhanArik

Thanks for reporting. Could you share the full stack trace?

BoD avatar Apr 03 '25 07:04 BoD

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!

BoD avatar Apr 03 '25 07:04 BoD

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

GokhanArik avatar Apr 08 '25 05:04 GokhanArik

Update: we received the schema/operations, thank you for that - and looking into it.

BoD avatar Apr 25 '25 10:04 BoD

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.

BoD avatar Jun 12 '25 17:06 BoD

Hi @GokhanArik 👋🏻 just wondering if you saw @BoD's message above? The new cache may resolve your issue, let us know 🙏🏻

bignimbus avatar Jun 26 '25 14:06 bignimbus