Hello, please help me check the issue with image saving,

Hello, could you please help me check the issue with saving images? When I ran the code locally, there were no errors, but when I tried to run it on the server, there were errors. What is the reason for this? Is there something missing on the server? Please refer to the problem.exe file for the problem, and the code.png file for the code

problem.zip (18.3 KB)

@Mikeykiss Could you please attach the problematic image here for testing? We will check the issue and provide you more information.
Have you tried increasing java heap size?