Não foi possível reservar memória embora haja espaço

1

Estou tentando usar o Weka ( link ) em um sistema Windows 7 de 64 bits que é por natureza muito ligado à memória. O problema é que meu PC tem 8GB de RAM e meu gerenciador de tarefas diz que apenas 1,5 estão alocados. Mesmo assim, quando tento rodar o Weka, que supostamente usaria apenas 3 desses GB, ele falha com o seguinte erro:

Error occurred during initialization of VM
Could not reserve enough space for 3072000KB object heap

Idéias?

    
por lucasnadalutti 06.11.2015 / 01:39

1 resposta

4

Ocorreu um erro durante a inicialização da VM

Could not reserve enough space for 3072000KB object heap

Você precisa aumentar o tamanho máximo de heap da JVM.

Tente:

java -Xmx4g ...

Nota:

  • Você também precisará verificar se possui uma versão de 64 bits da JVM instalada.

OutOfMemoryException

Most Java virtual machines only allocate a certain maximum amount of memory to run Java programs. Usually this is much less than the amount of RAM in your computer. However, you can extend the memory available for the virtual machine by setting appropriate options. With Sun's JDK, for example, you can use

java -Xmx512m ...

to set the maximum Java heap size to 512MB. You can use -Xmx2g to set it to 2GB.

For more information about these options, follow this link.

Note:

Do not use the -Xms parameter as well, as this will lead quickly to an OutOfMemoryException.

If you are using WEKA under Windows and start WEKA from the Start Menu, check out the Invocation section of the Java Virtual Machine article, it explains what files you have to edit in order to give WEKA more memory (RunWEKA.bat or RunWEKA.ini, depending on your version).

But please have in mind, that your hardware architecture and/or operating system will limit the amount of memory you can allocate (see the 32-bit and 64-bit sections of the Java Virtual Machine article).

Fonte OutOfMemoryException

Posso verificar quanta memória está disponível para o WEKA?

You can easily check, how much memory WEKA can use (this depends on the maximum heap size the Java Virtual Machine was started with).

  1. developer version
    • start the SimpleCLI
    • run the following command:
    • java weka.core.SystemInfo
    • the property memory.max lists the maximum amount of memory available to WEKA
  2. book version (and developer version)
    • start the Explorer
    • right-click in the log panel
    • select Memory information to output the information to the log

In case you should run into an OutOfMemoryException, you will have to increase the maximum heap size. How much you can allocate, depends heavily on the operating system and the underlying hardware (see sections 32-Bit and 64-Bit of the Java Virtual Machine article). Also, have a look at the OutOfMemoryException section further down.

Fonte Posso verificar quanta memória está disponível para o WEKA?

Leitura Adicional

por 06.11.2015 / 12:06