IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Tomcat et TomEE Java Discussion :

Could not reserve enough space for object heap


Sujet :

Tomcat et TomEE Java

  1. #1
    Membre à l'essai
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 13
    Points : 10
    Points
    10
    Par défaut Could not reserve enough space for object heap
    Bonjour à tous.

    J'ai constaté que mon serveur tomcat plante souvent lorsque je fais des tests de charge via j-meter.

    Je suis sur un serveur 4 coeur dont la mémoire est de 6Go et où le PAE est activé.

    J'ai donc tout simplement testé par dichotomie la valeur maximum que je peux allouer à la JVM, et ce maximum est de 2.7Go.

    Pourquoi ne puis-je pas allouer plus de mémoire à ma JVM ?

    java -Xmx2700m -version
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
    FREE
    total used free shared buffers cached
    Mem: 6096924 861924 5235000 0 76800 580968
    -/+ buffers/cache: 204156 5892768
    Swap: 2040244 0 2040244
    cat /proc/meminfo
    MemTotal: 6228500 kB
    MemFree: 5175508 kB
    Buffers: 46176 kB
    Cached: 849264 kB
    SwapCached: 0 kB
    Active: 337696 kB
    Inactive: 658632 kB
    HighTotal: 5372252 kB
    HighFree: 4417408 kB
    LowTotal: 856248 kB
    LowFree: 758100 kB
    SwapTotal: 2040244 kB
    SwapFree: 2040244 kB
    Dirty: 5340 kB
    Writeback: 0 kB
    Mapped: 118356 kB
    Slab: 41172 kB
    CommitLimit: 5154492 kB
    Committed_AS: 263712 kB
    PageTables: 1908 kB
    VmallocTotal: 106488 kB
    VmallocUsed: 2608 kB
    VmallocChunk: 103436 kB
    HugePages_Total: 0
    HugePages_Free: 0
    Hugepagesize: 2048 kB
    vmstat
    vmstat
    procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----
    r b swpd free buff cache si so bi bo in cs us sy id wa
    1 0 0 5143060 48320 880140 0 0 30 100 562 146 2 1 96 1
    Je vous remercie d'avance pour vos solutions

  2. #2
    Membre à l'essai
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 13
    Points : 10
    Points
    10
    Par défaut
    Personne n'a rencontré ce problème?

  3. #3
    Expert confirmé
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 274
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 274
    Points : 4 141
    Points
    4 141
    Par défaut
    Pourquoi tu as besoin d'autant de mémoire ?

  4. #4
    Membre à l'essai
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 13
    Points : 10
    Points
    10
    Par défaut
    bonjour fr1man,

    J'en ai besoin pour effectuer des benchs sur des webservices, pour identifier le nombre maximum de clients qui peuvent se connecter. Et tomcat est très gourmand en ressources.

    As-tu une solution à mon problème ?

  5. #5
    Expert confirmé
    Profil pro
    Inscrit en
    Août 2006
    Messages
    3 274
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Août 2006
    Messages : 3 274
    Points : 4 141
    Points
    4 141
    Par défaut
    A priori, cela dépend de l'OS et de la JVM, sachant que sur une JVM 64 bits, il n'y aurait pas de limites.

  6. #6
    Membre à l'essai
    Profil pro
    Inscrit en
    Juin 2003
    Messages
    13
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2003
    Messages : 13
    Points : 10
    Points
    10
    Par défaut
    Effectivement, après une recherche un peu plus approfondi, voilà ce que j'ai trouvé sur le site de sun :

    The VM prints "OutOfMemoryError" and exits. Increasing max heap size doesn't help. What's going on?

    The Java HotSpot VM cannot expand its heap size if memory is completely allocated and no swap space is available. This can occur, for example, when several applications are running simultaneously. When this happens, the VM will exit after printing a message similar to the following.

    Exception java.lang.OutOfMemoryError: requested <size> bytes


    If you see this symptom, consider increasing the available swap space by allocating more of your disk for virtual memory and/or by limiting the number of applications you run simultaneously. You may also be able to avoid this problem by setting the command-line flags -Xmx and -Xms to the same value to prevent the VM from trying to expand the heap. Note that simply increasing the value of -Xmx will not help when no swap space is available.
    For more information, see the evaluation section of bug 4697804.

    Why can't I get a larger heap with the 32-bit JVM?

    The maximum theoretical heap limit for the 32-bit JVM is 4G. Due to various additional constraints such as available swap, kernel address space usage, memory fragmentation, and VM overhead, in practice the limit can be much lower. On most modern 32-bit Windows systems the maximum heap size will range from 1.4G to 1.6G. On 32-bit Solaris kernels the address space is limited to 2G. On 64-bit operating systems running the 32-bit VM, the max heap size can be higher, approaching 4G on many Solaris systems.

    As of Java SE 6, the Windows /3GB boot.ini feature is not supported.

    If your application requires a very large heap you should use a 64-bit VM on a version of the operating system that supports 64-bit applications. See Java SE Supported System Configurations for details.
    Donc théoriquement c'est possible que je puisse augmenter mon heap space. En jouant sur l'espace swap, le kernel ...

    Sinon comme tu le dis, reste la solution de passer en OS 64bits...Et ce n'est pas prévu actuellement.

    En tout cas merci, je suis fixé sur le pourquoi de la chose...

    ++

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 6
    Dernier message: 26/08/2011, 13h30
  2. could not reserve enough space
    Par khaoula_14_05 dans le forum Développement Web en Java
    Réponses: 5
    Dernier message: 08/05/2009, 14h01
  3. Could not reserve enough space for object heap
    Par zerocoolyoussef dans le forum Développement de jobs
    Réponses: 2
    Dernier message: 03/05/2009, 20h13
  4. [phpBB] Could not get theme data for themes_id
    Par leech2004 dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 1
    Dernier message: 26/09/2007, 15h18
  5. Réponses: 5
    Dernier message: 16/12/2005, 07h37

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo