Error on loading pdf

I am trying to load a fillable pdf form. I have written the code and the code is working when i try to run the code from terminal using php command. But when i access the same file using the url its giving me error “Error occurred during initialization of VM
Could not allocate metaspace: 1073741824 bytes”. I have installed openemr on ubuntu 20.4. the memory limit is 2048M.