• Bugs
  • Spine cannot allocate enough memory

Related Discussions
...

Hi, today i encounter a problem when exporting my animation, it's a huge file that contains almost 1000 skins, i was able to export the same file with just 600 skin before, but today after adding new skins, i cant export it anymore, i'll post the log here, pls help me determine the problem as my deadline is killing me 🙁(

NVIDIA Corporation, NVIDIA GeForce GTX 1050/PCIe/SSE2, 4.6.0 NVIDIA 511.79
Starting: Spine 4.0.61 Professional
Spine 4.0.61 Professional
Licensed to: [pls allow me to hide this]
Using customized hotkeys: hotkeys-1.txt
Started.
OpenAL 1.1, Default audio device
Update available: 4.1.20-beta
WARNING: Slow file system access: D:/Freelance Job/Kubird/Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/
Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/Quarter View
WARNING: Slow file system access: D:/Freelance Job/Kubird/
Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/
Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/Quarter View/./images
WARNING: Slow file system access: D:/Freelance Job/Kubird/
Quarter View
WARNING: Error packing images:
[OutOfMemoryError] Java heap space
at s.kkh.<init>(:87)
at s.juM.
(:115)
at s.LUb.
(:133)
at s.qEn.
(:458)
at s.qEn.
(:426)
at s.qEn.
(:269)
at s.qEn.
(:207)
at s.qEn.
(:180)
at s.qEn.
(:69)
at s.AVz.
(:131)
at 0x0000000100659b30.pack(Unknown Source)
at s.dNy.
(:164)
at s.AVz.
(:134)
at s.IJh.
(:285)
at s.slU.
(:248)
at s.IJh.
(:77)
at s.IJh.
(:188)
at s.kdt.
(:97)
at java.lang.invoke.DirectMethodHandle$Holder.invokeVirtual(DirectMethodHandle$Holder)
at 0x00000001000a2800.invoke(LambdaForm$MH)
at 0x00000001000a2c00.linkToTargetMethod(LambdaForm$MH)
at s.fOu.
(:613)
at 0x000000010064bcd8.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
WARNING: Memory usage:
Available / max: 2.1 GB / 2.1 GB (96.9%)
Allocated / max: 234.9 MB / 2.1 GB (10.9%)
Used / allocated: 65.9 MB / 234.9 MB (28.0%)
ERROR: Unable to allocate memory:
[OutOfMemoryError] Java heap space
at s.nXV.
(:475)
at s.vwy.run(
:73)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
ERROR: Out of memory:
ERROR: Sorry, Spine was unable to allocate enough memory.

Sorry you are having trouble!

The forum will automatically remove your license information when you post logs.

The Slow file system access log messages mean you are using a network drive that is very slow.

It's surprising you run out of memory. You might consider other ways to arrange your project, for example to create attachments/skins at runtime:
Runtime Skins - Spine Runtimes Guide: Creating attachments

You can change the max memory Spine can use by passing a command line parameter when Spine is started. For example:

Spine.exe -Xmx4096m

That gives Spine a maximum of 4GB. You can replace 4096 with the number of megabytes you want to allow Spine to use. For example for 16GB use -Xmx16384m (16 * 1024 = 16384).

Nate schrieb

Sorry you are having trouble!

The forum will automatically remove your license information when you post logs.

The Slow file system access log messages mean you are using a network drive that is very slow.

It's surprising you run out of memory. You might consider other ways to arrange your project, for example to create attachments/skins at runtime:
Runtime Skins - Spine Runtimes Guide: Creating attachments

You can change the max memory Spine can use by passing a command line parameter when Spine is started. For example:

Spine.exe -Xmx4096m

That gives Spine a maximum of 4GB. You can replace 4096 with the number of megabytes you want to allow Spine to use. For example for 16GB use -Xmx16384m (16 * 1024 = 16384).

Thanks for your help Nate, might if i ask where to put that command line parameter ? im dump at tech :lol:

You can run Spine from the command prompt, or it may be easier for you to modify your Spine shortcut. Find the Spine entry on your start menu, right click, properties, for Target add the parameter, eg:

C:\Program Files\Spine\Spine.exe -Xmx16384m
Nate schrieb

You can run Spine from the command prompt, or it may be easier for you to modify your Spine shortcut. Find the Spine entry on your start menu, right click, properties, for Target add the parameter, eg:

C:\Program Files\Spine\Spine.exe -Xmx16384m

Thank you for your help Nate, im able to solve my problem and export the file, save me from the deadline :lol: you're the best 😃

Great! Glad it worked out.

18 Tage später
Nate schrieb

Hi, Nate
I want to ask you how I increase spine space? if you can write steps, please?

Nate schrieb

Spine.exe -Xmx4096m

@Ahmed, what OS are you using?

@[gelöscht]
Edition: Windows 11 Pro
Version: 21H2

Open Command Prompt and run:

cd C:\Program Files\Spine
Spine.exe -Xmx4096m

Or you can change your Spine shortcut to add the argument. On your start menu, right click Properties, set the Target to:

C:\Program Files\Spine\Spine.exe -Xmx4096m

Thank you for your help Nate

ein Monat später

Hi Nate, is there a way to do it on a Mac? We've tried using terminal but it doesn't work.

Yes, it should work like this:

/Applications/Spine.app/Contents/MacOS/Spine -Xmx4096m

Spine doesn't seem to be a java application on Mac, and it doesn't recognize the Xmx parameter

Spine uses Java internally, it doesn't use the system Java and it's launched with it's own launcher, not by running Java.

I'm away from the office and don't have access to a Mac at the moment, but it should work. Can you show the terminal with the command and the result you get?

What version of the Spine launcher (not editor) are you using? You can see it in the first line of your spine.log.

3 Monate später

I just tried on a mac and it seems correct that it does not recognize the Xmx parameter. ERROR: Unrecognized command line parameter "X": -Xmx4096m in terminal when trying to open the application the way you recommend. Spine Launcher 4.1.04

Ah, you're right. We've fixed it in launcher 4.1.09. Sorry for the trouble!

Please note that -Xmx does not apply to Spine editor versions < 4.0. Those always use 1024MB of RAM max because they are 32-bit and cannot allocate much more.