Best GC options for minimum memory usage?

It seems that the more -Xmx memory I set, the more memory my app is using. Alas, the garbage collector is controlling the memory by itself and even System.gc() does not garbage collect all unused objects.
There are lots of parameters at http://java.sun.com/docs/hotspot/VMOptions.html, but what's the most aggressive one(s) to free unused memory as soon as possible?

Hi Martin,
please, let me tell you a few basic things first:
- under good circumstances the GC runs only when some heap space is full and more
memory is needed.
- even if the GC frees memory it will usually not be returned to the OS immediately but only
when some other process needs it. This means you will not see processes shrink
immediately when the JVM reduces its heap sizes. This is certainly true for Solaris.
- it is bad practice to call System.gc() in your Java code.
- the smaller the configured heap the more time (in percent) the JVM will use for GC. This is
because the memory in use has to be searched each time the GC runs
- the heap actually used by your JVM adds to the real memory size of the process
- the max values (-Xmx + -XX:MaxPermSize) add to the virtual memory size of the process
even if these max values are not actually used
Now, knowing these, to minimize your actual heap usage, I recommend you the following settings:
-Xms20m # set this to the minimum you will need, omiting it only slows down JVM startup
-Xmx200m # set this to the maximum you might need or can spare
-XX:MinHeapFreeRatio=20 # minimum heap percentage free after a Full GC, default=40
-XX:MaxHeapFreeRatio=40 # maximum heap percentage free after a Full GC, default=70
-XX:NewSize=10m # don't make it too small because this will make GC less efficient, the
# actual value depends on the nature of the app
-XX:MaxNewSize=10m # ditto, you can only make it larger than NewSize
-XX:SurvivorRatio=6 # try to compensate for small NewSize
-XX:TargetSurvivorRatio=80 # don't waste survivor space memory
I hope this helps. Please, keep in mind that a GC-based system is not really meant to
minimize memory usage!

Similar Messages

  • Best Export Options for QT5 Viewing

    I run a site for Mac OS 7 users and want to upload some videos there in QuickTime 5 format (the latest version for Mac OS 7). I am working on a G4 running Tiger and QuickTime 7 Pro.
    What are some of your opinions on the best export options for QT5 viewing, distrubed over the internet, at say 320x240?

    Alas, the data rate of these two video codecs must be a lot higher (at least 25% more than the more modern codecs) to ensure a good visual experience.
    A neat html "trick" is to encode with these higher data rates but at a smaller dimension. Instead of 320X240 use 160X120. The smaller dimensions help keep the file size down. During html playback use the object and embed tag to scale="tofit" and enlarge the playback area.
    Your src (source) tag dimensions are larger than the original source file. Using scale="tofit" tags the file plays at the designated size instead of the original (160X120) size.
    The pages hosted for .Mac users (iWeb and Homepage) use the opposite tag (scale="aspect") that fit the source to the template of the page. One of mine as an example:
    http://homepage.mac.com/kkirkster/zoom/

  • What's the recommended setting for "Process memory usage" ("process virtual" in UI) for a 64-bit host on a 64-bit OS?

    Hi gurus
    In resource based throttling, what's the recommended setting for "Process memory usage" ("process virtual" in the resource based throttling tab of the UI) for a 64-bit host
    on a 64-bit Windows OS?
    According to MS (http://msdn.microsoft.com/en-us/library/ee308808(v=bts.10).aspx):
    "By default, the
    Process memory usage throttling threshold is set to 25. If this value is exceeded and the BizTalk process memory usage is more than 300 MB, a throttling condition may occur. On a 32-bit
    server, you can increase the Process memory usage value to 50. On a 64-bit server, you can increase this value to 100. This allows for more memory consumption by the BizTalk process before throttling
    occurs."
    Does this mean that 100 is the recommended setting for a 64-bit host on a 64-bit Windows?
    Thanks
    Michael Brandt Lassen

    Hi Michael,
    Recommended setting is the default setting which is 25 .dot.
    If your situation is abnormal and you see message delivery throttling state to “4” when the following performance counters are high or if you expect any of you integration
    process could have impact on following counters, then you can consider the suggestion by Microsoft. Don’t change the default setting.
    High process memory
    Process memory usage (MB)
    Process memory usage threshold (MB)
    You can see these counters under “BizTalk:MessageAgent”
    You can gauge these performance counter and its maximum values if have done any regression/performance testing in your test servers. If you have seen these counters having
    high values and causing throttling, then you can update the Process memory usage.
    Or unexpectedly you’re process high throughput messages in production which is causing these counters to go high and cause throttling, then up can update the Process memory
    usage.
    The above two cases where I know my expected process usage (by doing performance testing) or suddenly my production server processing has gone high due to unexpected business
    hike (or any reasons) which caused throttling, then do changes to default throttling setting.
    Just changing the default setting without actual reason could have adverse effect where you end up allocating 
    more processing capacities but the actual message processing message usage ever is low means you end up investing in underutilised resources.
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • What's the best importing option for a Flash video?

    I've got a few encoded high definition videos that are now .flv files and I'm wondering which is the best option to choose when importing the .flv file into my Flash project? I'm looking for fastest loading/streaming with best quality to be the result. If I choose a streaming option like progressive download from a web server, would the choice be dependent on the type of server the file(s) are hosted on? I'm using Flash Professional 8.

    Hi,
    The best importing option for video is streaming from flash media server. Below I discuss the drawbacks if you use other alternatives.
    i) If you use embed video option
    File size will go huge. Loading time will be higher. This is not a good option if you have big size video files.
    ii) If you use progressive download from a web server
    Video file gets downloaded to the client machine during the progressive download. Since video file is downloaded into the client machine, there are chances of the external user to reuse the same video.
    iii) If you use streaming from flash media server
    Video directly gets streamed from Flash Media Server. In this case, video file download does not happen on the client side. Video file security concerns are already addressed by Flash Media Server protocols.
    Thanks

  • Best export option for Sound Designer

    Hi everyone,
    I am working on a new short film and I am working with a Sound Designer and composer.  We want to create a 5.1 mix for the film (which I have never done before).  So I am trying to figure out what would be the best export option for him to work with to make his life easier.
    Providing him with just a ProRes export won't help him match up to my cuts in the time line since he doesn't use FCP X.  So my thought is that we will have matching files and folder structure for both video and audio before I start editing.  But what I am not understanding is once I have a complete rough cut, how do I get him a cut list so that he can totally match up my cuts with the same audio files on his system?
    Any advice?
    Thanks.

    See this pic for an example of how my exports turn out:
    http://www.brettmichaelwiesman.com/temp/qtexport.jpg
    First off, the titling style is not ideal for DV (or DVD). That is, your font should be a bit fatter (or, at least, bold) and perhaps 1-2 point sizes larger. (This is all because the DV codec makes titles look like s--t if the font size is small and narrow)
    Also, for your LiveType files, make sure FCP is interpreting your alpha channel correctly. For every LiveType file placed in your timeline, select it, then press Command-9 to bring up the Item Properties dialog. In the column for Alpha, make sure it says it says Black. If, for instance, it reads Straight, Control-click [right-click] on Straight, then select Black from the contextual menu. You should notice your text 'popping out' a little more. You'll have to re-render, of course.
    Also, in QuickTime Player, press Command-, (that's  + comma) to bring up QT's preferences. Make sure that the box for Use High Quality Video Setting when available is checked. (In order to get this working, it's probably best to set this, then restart QT - or close, then open, all movies). With the High Quality flag always used, your titling should always look better in QT player. (That is, there is no change made to your actual file, but at least when previewing, you'll get a better idea of things)
    After you've made these changes, export as you were (Current Settings) and let us know if you see any improvements.

  • What is the best printing option for iPad (3)

    What is the best printing option for iPad (3)?

    The BEST option would be to buy a wireless printer that supports AirPrint, a wireless printing feature.

  • Best logging option for SharePoint 2013 on-premise application

    What is the best logging option for SharePoint 2013 on-premise application?

    Hi,
    According to your post, my understanding is that you want to know the logging option in SharePoint 2013.
    SharePoint has its own logging system called “Unified Logging System (ULS)“, we can use the ULS log to see if anything unexpected occurred, we can use the
    ULSViewer for more convenient log viewing experience.
    Or we can log information programmatically.
    There are some logging classes can be used, such as
    SPMonitoredScope ,  SPDiagnosticsService, or create your own “Diagnostics Service” – which is technically just a new class inherited
    from SPDiagnosticsServiceBase. 
    We can also utilize diagnostics.asmx web service for the client side applications.
    For more reference:
    http://www.codeproject.com/Articles/620996/Five-suggestions-to-implement-a-better-logging-in
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • I purchased a  MBP 13.3/2.5/8GB/128GB FLASH from Apple store in Manhattan Beach,CA some months ago. It has only 128 GB storage. What us the best practical option for additional storage ?

    I purchased a  MBP 13.3/2.5/8GB/128GB FLASH from Apple store in Manhattan Beach,CA some months ago. It has only 128 GB storage.
    I soon realized that I did a big mistake not upgrading the storage when purchasing. I thought I could upgrade later which is not possible I understand.
    My Q:
    What is the best and most practical/userer friendly option for additional storage say up to 1 TB ?

    Hey leiv karsten,
    As your macbook is retina,you can't upgrade it like previous generation macbook pro.You can purchase a portable 1TB external harddrive.
    http://www.amazon.com/s/ref=lp_595048_nr_p_n_feature_two_brow_5?rh=n%3A172282%2C n%3A%21493964%2Cn%3A541966%2Cn%3A1292110011%2Cn%3A595048%2Cp_n_feature_two_brows e-bin%3A5446812011&bbn=595048&ie=UTF8&qid=1368944651&rnid=562234011

  • What is the best "insurance" option for an iPhone?

    Hey all. So I'm almost at the point where I can finally afford getting myself an iPhone and I definitely don't have the funds to be able to replace it if something were to go wrong. So I'm wondering what is the best insurance plan for an iPhone? I'm not the clumsiest person, but I have been known to drop a gadget every once in a great while and I definitely don't want to break an iPhone.
    Apple obviously has AppleCare, but that doesn't cover physical damage. I know Best Buy's covers accidental damage, but that's 15 bucks a month...more than I'd like but that's a nice incentive. Are there any other good options that would cover physical damage? I used to work for Best Buy and I've never had any trouble with their BTP plans, I'm just not a huge fan of the idea of paying 15 bucks a month. Any other plans I don't know about?

    Safeware http://www.safeware.com/ specializes in laptop, etc coverage, including smartphones. I bought a laptop policy from them around 2002, but since I never had to claim on it, cannot speak as to their customer service or anything. A google on "smartphone insurance" may turn up more specialized companies.
    I recently noticed, and it was total news to me, that one of those credit cards I picked up in college for the free t-shirt and have had for 10-15 years, includes insurance coverage for my mobile phone. This particular card is branded AT&T and doubles as a calling card, and I'm guessing that's why. I haven't checked into the details, but people might keep an eye out for something random like that.
    I should ask my renter's insurance about the phone.

  • Best output options for EX1 XDCAM?

    Does anybody have a recommended output option for a 50-minute film edited on a mix of primarily EX1 HD, but including DVCAM?
    It needs to go to a post-house for grading and sound mixing.
    I want to preserve the 1920/1080i HD quality – so should the video be rendered to one of the FCP codecs and delivered as a digital file, or played out to an HD tape deck?
    If anybody has experience of this I’d be glad to hear about it. Thanks.

    Ask the post house what they prefer. They can provide better info than a bunch of us Yanks can. They know what file formats/tape formats they can deal with.
    Shane

  • Best support option for failing Bluetooth?

    In the past few weeks or so, my Macbook has been losing bluetooth connectivity intermittently. I was hoping that somehow the 10.4.8 update would help, but if anything it's only gotten worse. Now it doesn't just happen when the laptop is hot, but also right after a cold boot.
    Anyway, I'm fed up and was wondering what would be the best support option. Should I call Applecare or take it to my local genius bar?

    So the problem was fixed at the Apple Store. They replaced my logic board and the bluetooth board + cable.
    I have to say that I'm impressed with the support I got this time. They ordered the parts and let me keep my laptop until they came in. I called to check in with them after several days when I hadn't heard back from them and was told they were still waiting on a few parts. The guy called me right back after he checked in the days shipment to tell me that the rest of the parts were in. I brought the laptop in that evening and the repair was complete the next morning. Very nice.
    I just wanted to throw that out there as I have posted my share of complaints about my MacBook here.

  • CI have a macbook 2.1 with 1GB of memory.  What are my options for adding memory s I can upgrade to Lion?  (I am running 10.5.8 now) and to icloud. I ve never been able to backup to idisk because of lack of memory also.

    I have a macbook 2.1 with 1GB of memory.  I have two issues- both related to lack of sufficient memory.  Issue#1 is upgrade to LION requires more memory than I have and I d  like to upgrade.  Issue 2 is that when ever i try to backup to idisk  I get a message telling me I need to remove some files from my start up disk to make room.   I don t know what I can remove without creating problems.  So  I think I need to add memory.  Is this possible?

    These are good online stores for Mac compatible RAM
    OWC http://eshop.macsales.com/shop/memory/MacBook/DDR2/ - Similar to DMS, they offer Mac tested RAM at very good prices.
    Crucial Memory http://www.crucial.com/ - good place to buy RAM from all over the world. They also have an excellent memory selector that allows you to choose memory based on your computer's model
    Data Memory Systems http://www.datamemorysystems.com/apple-memory.asp - another good, cheap place to buying RAM if you live in the U.S.
    Macdimms.com - Specializes in supplying Mac compatible RAM at extremely competitive prices. Brands featured include Crucial, Samsung, Hynix, and Micron. All brands carry a lifetime warranty. Discounts offered to educational institutions and students, active and retired military, resellers, and government agencies.
      Here are instructions on replacing RAM in a MacBook with a removable battery. http://homeoffice.consumerelectronicsnet.com/articles/viewarticle.jsp?id=44404
    If you don’t have the tools to open up the MacBook OWC has a set for $5
    http://eshop.macsales.com/item/OWC/TOOLKITMHD/
    You can put two 2gb RAM sticks in your model 2,1 but it can only use 3,3gb. This is a hardware limitation and cannot be changed.
    http://en.wikipedia.org/wiki/3_GB_barrier
    http://www.everymac.com/systems/apple/macbook_pro/faq/macbook-pro-core-2-duo-3-g b-memory-limitation-details.html
    OWC tests have found that there is a slight speed increase with having two 2gb sticks in rather than one 1gb and one 2gb. Your model is in the gray lines at the bottom of the graph. http://eshop.macsales.com/shop/Memory_Benchmark/Apple_MacBook/
    You can upgrade to 10.6 with no problems. Any program that runs under 10.5 will run under10.6. You might have to upgrade some drivers for printers, etc.... And you will have to install Rosetta if you have any Power PC applications http://www.macobserver.com/tmo/article/snow_leopard_installing_rosetta/  
    To upgrade your iLife and iWork. If you only want iPhoto or other single apps from iLife '11 you can get them from the App Store after you've upgraded to 10.6.6. iPhoto, iMovie or Garage Band for $15 each and Pages, Keynote or Numbers from iWork '09 for $20 each.
    You can order a Snow Leopard 10.6 install disk for $29 as long as you have at least1gb of RAM and 5gb of free space on your hard drive. http://store.apple.com/us/product/MC573Z/A?mco=MTY3ODQ5OTY
    Once you are at 10.6.8 you can buy Lion for $29 from the App Store if you have at least a model 2,1 MacBook. Lion will require at least 2gb of RAM but really needs 4gb to run smoothly. Also Lion doesn't run any Power PC programs. To see if you have any Power PC programs go to the Apple in the upper left corner and select About This Mac, then click on More Info. When System Profiler comes up select Applications under Software. Then look under Kind to see if any of your applications are listed as Power PC. Universal and Intel will run under Lion.
      Before Mac switched to Intel processors they used Power PC processors from 1994 to 2005. Power PC 601 through 604, G3, G4 and G5. Applications written for the Power PC processors need the application called Rosetta to run on Intel processors. This was part of the Operating System in 10.4 and 10.5 but was an optional install in 10.6. With 10.7 Lion Apple dropped all support for Power PC applications.

  • "Calculate Average" option for the Activity Usage Profile doesn't work

    I have the same problem as poster 793128 in a comment for a different thread: the "calculate average" profile option doesn't work for units (it works for cost though). I've used this option a lot on previous versions of Primavera but for some reason is not working on our new P6 release 7 (stand alone). As 793128’s post says: nothing happens, nothing changes, the profile keep showing totals, doesn't matter if the "base hours on time period" box is selected or if the divider is input by the user.
    The same option (calculate average / divide by) on the resource usage spreadsheet and on the tabular reports do work as expected so doesn't seem to be that I checked the wrong box for some user or administrator preference set up.
    Thank you for any help or clue. I posted this as a different thread because my original post was in a resource profile thread for a different issue that was already answered.

    *793365,*
    After reading your post I tested an older layout of mine that uses a similar setup and it still operates fine. On the "Resource Usage Profile Options" box under the "Graph" tab, I have "Calculate Average" checked and "24" entered in the "Divide interval totals by:" box.
    This allows my resource profile to display manhours per day for me.
    Some of my background info:
    I run in a multi-users platform and not in a stand alone setup.
    We have different resources loaded into the schedule with multiple calendars.
    I have several "Resource Filter/Group Names" setup for each separate resource on the "Data" tab too.
    Hope this helps,

  • What is the best export option for video podcasting purposes?

    Although Quicktime has an "Export to iPod" option, I was wondering if there was any better means to export from FCP or Quicktime for purposes of podcasting and YouTube posting to ensure best quality while containing file size.
    Thank you for your help!

    Felix,
    use Compressor.
    1)Look into Settings presets, towards the bottom. You have several options and the best for you comes from testing a few, just a few seconds each.
    2)In inspector you can customize settings further.
    Have fun,
    G.

  • Best output option for video when doing adr and vocal recording?

    I know this topic has come up before on occasion but I wanted to bring it up to hopefully reach a final conclusion.
    Does anyone know the best configuration to use for ADR and other vocal recording in Logic when the mic and screen are in a separate room? The options I've seen so far are:
    - Send video via DV firewire to a converter box and then to a monitor. With limited firewire ports already in use for the audio interface and dsp units, has anyone tried daisy chaining or using a firewire hub for dv output to a monitor?
    or
    - Use a DVI splitter to run to a 3rd LCD monitor(as a 2nd one is already in use) so the regular 'video window' could be dragged across to appear on the vocalist/actor's monitor.
    These are the only choices I've seen seen so far but if anyone has any other's or recommendations on which of these to go for, I'd love to hear them.
    Cheers
    Paul

    Anyone?

Maybe you are looking for

  • Updated ipod nano is now not recognised by windows or itunes

    Hi, I am sure there would be numerous people who are in the same situation. Being computer illiterate does not help the situation i tell you. Can anyone please help?

  • Swing is great !!!!!

    Hi guys I've been working in swing for a last 5 years developing a client server and a GUI library. I've been working in coding our java beans (MyJTable, MyPopupDataTextField etc,etc) and our data JDBC beans. The only thing I could say now is that th

  • This Entry Already Exists in the following table (DLN1) ODBC-2035

    Hello Experts, I am getting the following error while entering the Deliveries : "This Entry Already Exists in the following table (DLN1) ODBC-2035 Message: 131-183" can not enter deliveries. Kindly Help

  • Order entry per Customer Item

    Hi, does anybody know if it's possible to enter Sales Orders per Customer Item instead our own internal item number? In our Sales Order Organizer form I can not see nor enable the column "Customer Item". Thanks, David.

  • Problems with Norton

    I have Norton confidential, antivirus and firewall on my Mac running 10.6.8. when I open Firefox, Norton tells me I cannot be protected while surfing the web; that I need 1.5 version. However, the Firefox version installed on my computert says I have