Results 1 to 6 of 6

Thread: -Xmx Problem

  1. #1
    TheYolocasut1 is offline Member
    Join Date
    Jul 2016
    Posts
    3
    Rep Power
    0

    Default -Xmx Problem

    For some reason, some programs will not run unless Java's Xmx is set to 512M in the environment variables. Arduino is one of these programs. My issue is when I play Minecraft with these settings, I run out of RAM. I usually play Minecraft with -Xmx5G. Am I supposed to change the setting every time I want to use a different Java application? Why do some programs fail to launch just because they have a lot of allocated RAM?
    Last edited by TheYolocasut1; 07-19-2016 at 11:11 PM.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,963
    Rep Power
    31

    Default Re: -Xmx Problem

    Using Environment variables for values that are unique to different applications won't work. It would be better to create shortcuts for each application. In that shortcut set the command line to the values you want for the program that is started.
    For example, I have this as the Target in a shortcut to start a program:
    C:\Windows\System32\java.exe -Xmx750M -cp %JAVA_RUN%\SlideShowApp.jar;DocumentViewerW.jar SlideShow.ImgIdxEditor
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    TheYolocasut1 is offline Member
    Join Date
    Jul 2016
    Posts
    3
    Rep Power
    0

    Default Re: -Xmx Problem

    Both Minecraft and Arduino use windows executables for launchers. I cannot figure out how to launch the program via command line. Also when I tried using a batch file to launch a jar, even though I had -Xmx512M in the command line, it still said "Picked up Java options -Xmx5G".

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    19,963
    Rep Power
    31

    Default Re: -Xmx Problem

    Did you remove the environment variable?
    If you don't understand my response, don't ignore it, ask a question.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: -Xmx Problem

    I did a search for "memory settings for minecraft" and found the following:

    Did you check out this site? [Tutorial] Allocate more memory for minecraft - Tutorials and FAQs - Unmodified Minecraft Client Support - Support - Minecraft Forum - Minecraft Forum

    Supposedly, there is a new launcher which lets you configure the JRE memory requirements. Note: For application problems based on Java, don't check Java sites; check the application sites. Most folks who have similar problems will report them there.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    TheYolocasut1 is offline Member
    Join Date
    Jul 2016
    Posts
    3
    Rep Power
    0

    Default Re: -Xmx Problem

    I was not aware that I needed to delete the environment variable. After doing that, the applications' built-in Java options were able to do their thing. Thank you.

Similar Threads

  1. Replies: 5
    Last Post: 11-11-2015, 12:16 PM
  2. Replies: 0
    Last Post: 11-07-2012, 12:44 PM
  3. Small problem with problem with Java, C++ parse program.
    By dragstang86 in forum New To Java
    Replies: 4
    Last Post: 10-30-2011, 03:43 AM
  4. Replies: 9
    Last Post: 09-21-2010, 04:15 PM
  5. simple line problem / for loop problem
    By helpisontheway in forum New To Java
    Replies: 1
    Last Post: 11-17-2009, 06:12 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •