-Xmx considered evil (at least in the Windows desktop)

I've written my own launcher (actually, my own "wrap up Java as a COM object"). Occasionally, and rarely, the InitializeJVM call returns -4 (JNI_ENOMEM), even though there's plenty of memory available, according to the Task Manager. Reducing the max heap size gets around the problem, but that's not good, because my application can be a bit of a memory hog.
So, I have two questions:
1. What does {color:#ff0000}InitializeJVM {color}actually do (on Windows)? Does it do a VirtualAlloc MEM_COMMIT? If it's not committing, it can't possibly run out of virtual address space. But, it's silly for it to commit. Besides, looking at the memory usage more closely, it's clear that the heap is not fully committed. So, does it MEM_COMMIT then MEM_DECOMMIT? That doesn't make sense.
2. Why does Java bother with a maximum heap size, anyway? Windows doesn't restrict process space. Of course, the underlying resource, the page file, can be exhausted. But them's the breaks. I do not see how Java can possibly guarantee the requested heap space will be available in the page file (e.g., as committed memory) when needed, since it doesn't commit what it's not using. Some other process could easily gobble up the page file and leave none for me.
I imagine Java is doing something I don't understand. I wish I did understand it, because then I could fix my problem.
I'm hoping someone with access to the code implementing InitializveJVM can read it and tell me how it treats the -Xmx parameter.

Doctor_Dad wrote:
Memory leaks are possible in both GC'ed and non-GC'ed environments. I maintain it's easier to think about in non-GC'ed environments. In an alloc/free environment, the programmer has the obligation, having coded the alloc, to code the free and to arrange to have it called. He can then use the object. In a GC'ed environment, there's no simple way to think about how to ensure that the newly created object will eventually become garbage. That is my fundamental objection to Garbage Collection. It is impossible to think about clearly. And what matters in the business of software development is thought. Not technology. Not fancy Design Paradigms. Thought.
It is the same in both environments actually. And it applies to any resource not just memory.
Any resource has a runtime scope. At the end of that scope it must be deallocated.
The correct way for a designer and/or implementator to reduce problems is to consider that scope when the resource is first acquired and code appropriately for that.
An object's being garbage is a system wide attribute. An object reference exists in a web of references and one hopes one can turn the entire web into garbage by slicing a particular strand. But how easy is it to document (+a priori+) or determine (+a posteriori+) what that web is and how to slice it?
Except for the very, very rare object that is not a problem because of the limited set of references to it. If one has more than one type of class in even large apps which has more than a couple references then it would at least suggest a possible problem with the design.
The de-reference of a dead pointer is a bug that is often stumbled on during ordinary testing. A GC-memory leak can't be found unless you're actually looking for it with a memory analyzer. (OK, the same is true of memory leaks in non-GC'ed systems.)
(Ok nbr 2: De-referencing a dead pointer is a bug that can be very hard to diagnose.)
Simple solution to 2, set it to null. This is regardless of language being used.
And then there's the folk that have very tight scheduling deadlines and don't like GC randomly stealing CPU cycles. I'm not one of those people, so don't argue to me that it can all be adjusted with the right -XX parameter. I don't have any facts at my disposal to dispute it. However, the people I talk to who do have those deadlines say they can't use Java because it's GC'ed.
Huh?
I can only suppose that perhaps you meant someone with very strict timing requirements since that is the only relation to CPU. Most people that use GC options are either attempting to squeeze extra performance out of a system or they have a system that for some reason bogs down due to GC. Myself I suspect that the latter is due to a poor system rather than a short coming in GC itself and performance is always (again any language) much more stongly impacted by requirements/design than by implementation.

Similar Messages

  • Custom ADMX Template to change the Windows Desktop Icons Font colour

    Hi,
    I am wondering if anyone has a readymade ADMX template to chane the Windows Desktop Icons colours. It would be a great help if you could provide me a script as per your earliest convenience? Thanks much in advance.
    Regards
    Nitin Lal 

    Hi,
    Based on my test, we can modify the desktop icon font color from white to black.
    For details:
    1.   
    User Configurations -> Preferences -> Registry
    2.   
    Right click Registry, point New registry Item, choose Update Action.
    3.   
    Modify the Background color: HKCU/Control Panel/Colors/Background
    4.   
    Modify the key:0 0 0
    Hope this helps!
    Best Regards
    Elytis Cheng
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Forcing a JFrame to the top of the WIndows Desktop

    How do I force a JFrame to be displyed on top of everything else on the Windows desktop, i.e., a Java program running in the background needs to "pop-up" an error JFrame arbitrarily on top of anything else that is displayed.

    I'd search the forums, but I think the only way that this can truly be accomplished is through JNI. If you search for "always on top"+"JNI", I think a couple of people actually created some C classes that will do this.
    James

  • OpenAM on Windows - Need help with the Windows Desktop SSO [Video Inside]

    Hi everybody,
    first sorry if I make some mistakes as I dont speak english fluently, sorry :)
    I am trying to configure the Windows Desktop SSO of OpenAM on a Windows box.
    I followed this tutorial : http://docs.oracle.com/cd/E19681-01/820-3746/gisxh/index.html but when I check if SSO works (with this URL : http://FQDN_domain.llocal:8080/opensso/UI/Login?module=MySSOModule) , it fails with an error "authentication failed".
    1. First I would like to know if there is a way to check if the keytab generated is correct please. Indeed, I have read somewhere that the account name has to be identical as the name of the SSOServer; in my case it is not.
    I have correctly generated the keytab file (*or I think so but how can I be sure* ?).
    2. I would like to know how, in Windows, I have to configure the "keytab file name" (on the module instance page/ New Module).
    As I dont have /etc/opt etc... Do I have to specify a path like that ? : "D:\apache-tomcat-6.0.33\webapps\opensso\config\myfile.HTTP.keytab"
    3. I have also logfiles with debug mode enabled. It is available here : http://dl.free.fr/b6yPOoYTU/logauthent.txt.
    I will be very pleased if someone can help me about this problem that drives me nuts.
    Thanks a lot
    Edited by: 899066 on 24 nov. 2011 09:12
    Edited by: 899066 on 25 nov. 2011 08:42

    I have added a video of my configuration; if you see something "strange"
    You can watch it here : http://www.youtube.com/watch?v=UooRDIGm_4c
    Edited by: 899066 on 25 nov. 2011 08:43

  • How can I turn on the high contrast theme without the Windows Desktop being set to high contrast?

    Firefox 4.0 broke one of the best accessability addons that existed, AnyColor. Now I'm stuck with the closest I can get to it, a non-customizable theme which gets some things right but other things wrong.
    Naturally, I'd like to make my browsing as comfortable as possible to my low-vision eyes. I thought that the reported "high contrast" Firefox theme might help. Unfortunately, it seems that the only way to turn this on is to turn on high contrast themes in Windows-- and I have adjusted my Desktop so that I don't need them. Unfortunately that would seem to be the only way to get it in Firefox.
    Is there a secret way to force high contrast themes? The best solution for low-vision users, of course, would be to officially support AnyColor, or an addon like it.
    As an interim solution I'm using Purple Fox, which at least has the feature of being light text on a black background, and has visible tab close boxes; but it has fuzzy edges and twiddly graphics all over the place. It's not bad, it's just not really good. But having tried all of the themes with the word "dark" or "black" in the descriptions, it may be the closest to a working LV theme.
    Thanks for any help you might be able to give.

    NoSquint is certainly a nice AddOn, which does something helpful; but it doesn't enable high contrast themes, which is what the question was about.
    I have gone back to 3.6.16 in the meantime. I can continue to use AnyColor that way. The 4.0 upgrade seems to have more disadvantages than advantages.

  • How can I enable high contrast themes in Firefox WITHOUT high contrast on the Windows Desktop?

    Firefox 4.0 broke one of the best accessability addons that existed, AnyColor. Now I'm stuck with the closest I can get to it, a non-customizable theme which gets some things right but other things wrong.
    Naturally, I'd like to make my browsing as comfortable as possible to my low-vision eyes. I thought that the reported "high contrast" Firefox theme might help. Unfortunately, it seems that the only way to turn this on is to turn on high contrast themes in Windows-- and I have adjusted my Desktop so that I don't need them. Unfortunately that would seem to be the only way to get it in Firefox.
    Is there a secret way to force high contrast themes? The best solution for low-vision users, of course, would be to officially support AnyColor, or an addon like it.
    As an interim solution I'm using Purple Fox, which at least has the feature of being light text on a black background, and has visible tab close boxes; but it has fuzzy edges and twiddly graphics all over the place. It's not bad, it's just not really good. But having tried all of the themes with the word "dark" or "black" in the descriptions, it may be the closest to a working LV theme.
    Thanks for any help you might be able to give.

    Thanks for the reply. To clarify, by "Firefox chrome" I am referring to Firefox's GUI, such as the tab bar, scrollable context menus and the contents of the 'about:' pages. As a point of interest, Chromium on Ubuntu recently started supporting touch-scrolling for web pages and throughout it's interface.
    dom.w3c_touch_events.enabled sends touch events to the webpage, which is less important to me right now. In fact, others have reported that in situations where Firefox has touch-scrolling, enabling that option breaks the touch-scrolling for webpages that listen for the touch events (hence the default being 'disabled').
    I'd really like to know if native touch-scrolling is possible under Linux as my current setup is functional but not ideal.

  • I've downloaded firefox on my laptop, but I have windows 8. When I click on a windows 8 tile it takes me to the windows desktop to open the app.

    I still want to use my windows 8 tiles, but when I'm doing a web search I'd like to use firefox. I don't know the actual technological term for going from the Windows 8 tiles to the "old format" windows desktop, but I must have chosen the wrong settings for what I wanted. I hope this makes sense.
    Primarily I don't like the navigation toolbar and the task bar to show when I'm on Facebook, for example. This is why I want to use the Windows 8 tiles for some things and firefox for others.
    Is there a place I can adjust the setting?
    Thanks!

    I think you're talking about Firefox for Metro?
    Either way, that version of Firefox was pulled because of low user interest.<br>
    You can see the blog post about it:
    *https://blog.mozilla.org/futurereleases/2014/03/14/metro/

  • Ditch the Windows Desktop for Ipad?

    I would like to get rid of this monstrous Windows Desktop computer and use only an ipad.  I need a cleaner, more streamlined system that won't get bogged down with viruses and have to be replaced constantly. 
    I'm figuring I can just get a G-Tech G-Drive for additional storage space and the 64G Ipad. Are these two devices compatible? I only web bill pay and send an occasional email online.  Has anyone done this and know of any challenges I may be facing?
    Thanks,
    CD

    Operating with an iPad as your sole computing device can present some issues, depending on what types of activity you need it for.
    If you are doing fairly heavy duty work in word processing, spreadsheets and the like, youneed to be awae that most apps handling this type of activity are still fairly limited compared to the desktop versions (Numbers and all of the Excel replacements I know of cannot handle pivot tables, for example; you cannot install fonts in iOS; etc.). If your needs in this area are reasonably simple, however, it might work.
    You cannot connect just any external hard drive to an iPad. There is no USB or Ethernet connection. Consequently, and only with specific models of drive with WiFi built in, you can generally only consume content on the iPad from one. You can't write to it. You can, however, use cloud based services such as Box or Dropbox to store additional data and content, with some limitations.
    In the event something goes seriously amiss with the iPad, it is necessary to plug it into a computer running iTunes to resolve the issues.
    I am on my second iPad (first was a 1st gen purchased on the day of release) as well as two iPhone5's. I do about 95% of my non work computing on the iPad, have never had reason to do a full restore and the current devices have never been synced with itunes (I have iTunes match). So it is possible to do it, but not as easy as you might suspect.

  • [Desktop][Other] Ability to choose quality setting like in Android in the Windows desktop app

    So this goes like this: In the mobile app we can choose the streaming and download quality, but in the desktop we only have the Premium High Quality option. What happens is that if I have a very low internet connection of lets say 128kb, the Desktop software will not play the music because normal quality is 196kbps there, so having the ability to choose 96kbps or 128kbps bitrates can be useful

    Updated: 2015-07-23Hello and thanks for the feedback!
    A similar idea has also been suggested here:
    https://community.spotify.com/t5/Live-Ideas/96-kbps-added-to-desktop-version/idi-p/936723
    Add your kudos and comments there please! ;)

  • How can I switch off the automatic window size and set the size of the window manually

    I need to open the web-page in a window of a certain size. The javascript function window.resizeTo (w, h) does not work. If I open the window using the window.open ("", "", "width: w, height: h, ..."), there is another problem.
    The hyperlinks that have to be opened in a new tab in the same window or at least in the window of the same size, will open in another tab of the first window from which I called window.open().
    I do not know what it is, bug or as intended, but the normal full-featured window with the right size I cannot get.
    In Russian:
    Мне нужно открыть страницу в окне определенных размеров.
    Из консоли Firebug с помощью javascript пробовал window.resizeTo(w,h) - не работает. Если открывать окно с помощью window.open("", "", "width:w, height:h, ..."), то возникает другая проблема: ссылки, которые должны окрываться в новой вкладке в том же окне или хотя бы в окне того же размера, открываются в другой вкладке первого окна, из которого я выполнял команду window.open(), которое неправильного размера.
    Не знаю, что это. Баг или так задумано. Но открыть нормальное полноценное окно с нужными размерами не получается никак.

    You need an extension if you want to set the window dimensions to a specific value or you need to open a pop-up window with window.open and specify the width and height.<br />
    Otherwise a new window opens with some default dimensions as saved in localstore.rdf and you can't easily adjust the dimensions via JavaScript in that case.

  • Why the free version Skype for Windows Desktop is the only one with ads?

    Why? as the title ask? All the other Skype program on other platforn e.g. Android, iOS, Mac doesn't contain any ads, like the phone / tablet version does not seems to have one. The Mac version I don't really know, but people who uses skype on mac tells me there's no ad in their skype. Well maybe if there are, it might be not as annoying as the windows desktop version and they might have not noticed. I don't really care if you put ads in the program it's free anyway, but don't put and use ads that make the program looks cheap and annoys it user to use program. Anyway, I believe skype is seriously needed to be the main messaging/videocall app for windows (like mac's iMessage). Especially with the release of Windows 10 and if you're going to be that, putting such intrusive ads in the program is just not going to cut it, if you gonna put ads, do it right (at least). Seriously your ad placement is just like saying F**K you i'm going to put ads whereever i want. Skype is part of Microsoft now; It's very funny to see that Skype's on Windows (the OS Microsoft make) Desktop platform, is the skype platform I personally least like to use (I have use skype in android phone and tablet too, and on Mac). Like seriously, If you work with Microsoft, shouldn't you make a skype version that's bundled to Windows as Messaging service, like Windows Messenger back in windows XP days? 

    Hi Shanny33,
    Thanks for using Apple Support Communities.  This article has steps you can take for the error you're seeing:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    - Ari

  • I upgraded Firefox, and now there is a blue band on my screen above the window, and I'm not getting the full use of the screen in viewing web pages. How can I get the window to expand to fill the screen as it did before?

    There is a horizontal band or gap above the Firefox window at the top of the screen, where you can see the Windows desktop behind the Firefox window. On the left side of this band are the window tabs, and the menu bar, and another bar with the names of the open windows. I would like to have the Firefox window expand to fill the entire screen, like it did before the upgrade. Thanks.

    Do you mean running Firefox in full screen mode?
    *https://support.mozilla.org/kb/how-to-use-full-screen
    If you are in full screen mode then you can hover the mouse to the top to make the Navigation Toolbar and Tab bar appear.<br />
    You can click the Maximize button at the top right to leave full screen mode or right click empty space on a toolbar and use "Exit Full Screen Mode" or press F11.
    *https://support.mozilla.org/kb/how-to-use-full-screen
    You can also run Firefox in a maximized window to have easier access to the Menu bar and Navigation Toolbar.

  • Virtual PC 7 hid the mac desktop icons in Windows--how do you restore this?

    Hi there...hoping someone knows where one would be able to restore this setting this as I'm unable to locate anything through the preferences nor find any solutions in the user guide or online here in the group discussions.
    I have a client who is using an ibook G4 with VPC and her Mac icons disppeared from the Windows desktop after a popup window appeared and asked if she wanted to hide something and she accidentally clicked yes now the Mac icons are no longer visible on the desktop.
    Thanks for the suggestions.

    Hi there...thank you for the excellent help!
    With the Windows full-screen open press the command
    key so that the dock and the upper window will show
    up. Then, with the key still pressed, go to PC >
    Windowed mode.

  • Windows Desktop Search 4.0 How do I Format the Date Column in the Results?

    Is there a way to modify the date column in the Results pane of Windows Desktop Search 4.0?
    It's running on a Windows 2003 Enterprise server.
    I have users that need to modify files that arrived today and yesterday after 5:00 PM.  The date column only displays the time on files with today's date.  Is there some registry setting I can tweak to get this column to always show Date and Time?
    Cordially,
    RN

    Hi,
    For the Windows Desktop Search, i think you may ask in:
    http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?forum=windowsdesktopsearchhelp
    Regards.
    Vivian Wang

  • ITunes 6 prints text directly on Windows Desktop

    ITunes 6.0 and 6.0.1 come up, a lot of the time, printing tracks directly on the Windows desktop. That is to say iTunes doesn't have its skin and does not clear the space it is going to draw graphics on. It really only shows text when it does this. You can read the text but when you update something, new text prints over the old text without erasing the old text.
    I suspect this is specific to Windows 2000, but I really don't know.
    If I get this behavior, no matter how many times I restart iTunes, I can't get rid of it. But if I reboot Windows 2000, usually iTunes comes up the next time without this behavior.
    I use this Windows 2000 box mainly because it has a big disk on it. I use it only for iTunes and Slimserver (the Slim Devices streaming server).

    First, try the most obvious things. Make sure you have the latest drivers for your video card. Also reinstall the latest DirectX on your system. Those usually fix these sort of weird display issues.

Maybe you are looking for