You need to provide an additional AppSetting in the site configuration to override the default.
It is limited by the memory available on the App Service host from your selected SKU (P0v3, 4 GiB and P1v3, 8 GiB).
You need to provide the value in MB
.
Here's an ARM infrastructure as code file which shows exactly how to set the memory (and lots of other parameters); https://github.com/MaxMelcher/mevitco.profile.runtime/blob/da4a37a2fa83a8cc1f59c0957ca9ce72457341d9/mainTemplate.json#L178