ERROR on build: large file Java heap space /java.lang.OutOfMemoryError

Hello im having a problem with large files i think.

Builds: 3649 and 3654 where tested initially.

Whenever i have any file bigger than 40mb on my project i get one of those two errors:
-> “A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
17:30:36.822 > Java heap space”
-> A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
17:30:36.822 > java.lang.OutOfMemoryError (no error message)

Like i shown in those two images:
This ocurred when i copied a 41mb test file “.bin” to my project:

This ocurred when i had a 65mb mp4 file on the project:

the biggest problem is that i could make my build normally before with this 65mb video file inside it.
It works in an empty project regardles of the file size copied to it.

Something changed those days? how can i fix this?

thanks in advance!
my best regards!

EDIT: just changed my build from 2021.3649 to 2021.3642 and it worked.
But maybe i should try to optimize my app so it can work on the new builds.