Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8061843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T10:28:39+00:00 2026-06-05T10:28:39+00:00

Is there a way to make it so you can set memory usage arguments

  • 0

Is there a way to make it so you can set memory usage arguments inside a java class, not using eclipse or a java program compiler, just simple code that you can do inside a class using notepad or something.
If you don’t know what I mean, Here’s an example:

public class Example {
   public Example() {
     -Xmx("1024M");
   }

   public static void main(String args[]) {
     new Example();
   }
}

Please help, thank you!
Note: I don’t want to make a cmd/batch file to run it with -Xmx!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T10:28:41+00:00Added an answer on June 5, 2026 at 10:28 am

    The memory cannot be changed at run-time (by the time the JRE gets to your code statement, the memory has been set & cannot be changed). The only way to achieve a different memory size is to relaunch the app. using a Process specifying larger memory (then close the original app. that does not have enough).

    Of course, better to simply specify the required memory in the launch process (BAT file, JWS etc.).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way I can make an image 3d..like give it a 360
Is there any way I can make Firefox call a JavaScript function in my
Please is there a way i can make my error display dynamic for only
Is there a way to make this method generic so I can return a
Is there any way (utilizing Reflection I hope) that I can make an instantiated
Is there any way to make find-name-dired to only show filenames that I can
Since there is no way that you can make the flash object transparent, there
Is there a way to make an element not contribute to parent overflow, but
Is there any way to make this code shorter? price1 = input(\nEnter price here:
Is there a way to make a changelist restricted if any of the files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.