Java VM Heap

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kimbuba

    Java VM Heap

    Hello,
    do you guys know how to increase the maximum heap for the jvm?
    I know about giving to apps args like:
    -Xmx<size> set maximum Java heap size

    But i would like to give to my VM maximum heap defaults.
    Any application that will use my Vm is set as default to -Xmx256M; without
    setting it manually for each app.

    thnx!
    Kimbuba.


  • Jared Dykstra

    #2
    Re: Java VM Heap

    "kimbuba" <kimbuba3_NOSPA [email protected]> wrote in message news:<vnQSb.174 02$VS6.12536@to rnado.fastwebne t.it>...[color=blue]
    > Hello,
    > do you guys know how to increase the maximum heap for the jvm?
    > I know about giving to apps args like:
    > -Xmx<size> set maximum Java heap size
    >
    > But i would like to give to my VM maximum heap defaults.
    > Any application that will use my Vm is set as default to -Xmx256M; without
    > setting it manually for each app.
    >
    > thnx!
    > Kimbuba.[/color]

    It depends on your virtual machine.

    Note how this is problematic: The goal of Java is to 'write once, run
    anywhere.' If you have to tweak the VM, you begin to defeat this
    principle. If you need hundreds of megs available stack space,
    perhaps you should rework your code, removing some recursion and using
    a queue instead, thereby eliminitating a stack space dependency.

    ---
    Jared Dykstra

    Comment

    • nos

      #3
      Re: Java VM Heap


      "Jared Dykstra" <dyksjare@hotma il.com> wrote in message
      news:ba84b53e.0 402041048.2378b [email protected] gle.com...[color=blue]
      > "kimbuba" <kimbuba3_NOSPA [email protected]> wrote in message[/color]
      news:<vnQSb.174 02$VS6.12536@to rnado.fastwebne t.it>...[color=blue][color=green]
      > > Hello,
      > > do you guys know how to increase the maximum heap for the jvm?
      > > I know about giving to apps args like:
      > > -Xmx<size> set maximum Java heap size
      > >
      > > But i would like to give to my VM maximum heap defaults.
      > > Any application that will use my Vm is set as default to -Xmx256M;[/color][/color]
      without[color=blue][color=green]
      > > setting it manually for each app.
      > >
      > > thnx!
      > > Kimbuba.[/color]
      >
      > It depends on your virtual machine.
      >
      > Note how this is problematic: The goal of Java is to 'write once, run
      > anywhere.' If you have to tweak the VM, you begin to defeat this
      > principle. If you need hundreds of megs available stack space,
      > perhaps you should rework your code, removing some recursion and using
      > a queue instead, thereby eliminitating a stack space dependency.
      >
      > ---
      > Jared Dykstra
      > http://www.bork.org/~jared[/color]

      or you could convert local variables to fields
      then they would be on the heap and not on the stack


      Comment

      • kimbuba

        #4
        Re: Java VM Heap

        [color=blue]
        > Note how this is problematic: The goal of Java is to 'write once, run
        > anywhere.' If you have to tweak the VM, you begin to defeat this
        > principle.[/color]

        Ok wait!
        I begin to understand.
        You mean that if i tweak my VM to -> 256M and the app i use is build for 64M
        vms the app will never go behind that?

        I mean, if i'm using eclipse and i start eclipse with more than 64M there
        will be no improvments?
        Because if eclipse goes over 64m one day, it will goes on Out of memory for
        all the other standard users on all the world?

        I thought that java went on I/O swapping when no more memory is available.
        What you are telling me is that if the java memory goes over the allowed it
        will crash in any case?

        Thnx
        (do you have some resources on memory and java?)




        Comment

        • Jared Dykstra

          #5
          Re: Java VM Heap

          "kimbuba" <kimbuba3_NOSPA [email protected]> wrote in message news:<HJoUb.252 09$VS6.2090@tor nado.fastwebnet .it>...[color=blue][color=green]
          > > Note how this is problematic: The goal of Java is to 'write once, run
          > > anywhere.' If you have to tweak the VM, you begin to defeat this
          > > principle.[/color]
          >
          > Ok wait!
          > I begin to understand.
          > You mean that if i tweak my VM to -> 256M and the app i use is build for 64M
          > vms the app will never go behind that?
          >
          > I mean, if i'm using eclipse and i start eclipse with more than 64M there
          > will be no improvments?
          > Because if eclipse goes over 64m one day, it will goes on Out of memory for
          > all the other standard users on all the world?
          >
          > I thought that java went on I/O swapping when no more memory is available.
          > What you are telling me is that if the java memory goes over the allowed it
          > will crash in any case?
          >
          > Thnx
          > (do you have some resources on memory and java?)[/color]


          The goal is to simply use the stack space effectively. Use it but
          don't abuse it.

          As for memory allocation, the VM asks the OS for RAM. The underlying
          OS can then choose to use virtual memory or tell the VM no more memory
          is available. It is system dependant. The Java VM will not use swap
          space to create more memory--that is beyond the scope of a virtual
          machine.

          There is a book by o'reilly called "Java Virtual Machine" (ISBN:
          1-56592-194-1) that provides an overview of the VM. It's several
          years old now however. I'm sure better resources exist.

          ---
          Jared Dykstra

          Comment

          Working...