PDA

View Full Version : Low Memory Warning



dropblack
Apr 13th, '09, 11:38 PM
I've been getting a "low memory warning" whenever I load prefabs. Each time this warning comes up, HD dumps the prefabs I've loaded. I just reformatted my hard drive -- I didn't have any problems with HD the last time I reformatted it. I've got tons of hard drive space. I've attached a jpeg just for fun. Any ideas? Thanks.

Simon
Apr 14th, '09, 04:07 AM
It's not drive space -- it's memory (RAM). HD is given 64MB of RAM to play with. Under normal use, this allows you to work on some pretty extreme characters (I've had several "Dr. Destroyer" copies open with all abilities replicated multiple times through the characters -- no issues).

If you have a large number of prefabs or a smaller number of poorly-designed prefabs (that have a LARGE number of abilities defined), you will reach the memory limit of the application fairly quickly. The answer is to reduce the number of prefabs that you have open at any given time -- opening and closing them as needed.

Each ability in a prefab acts as if it is a part of the character (i.e. it is a part of all the recursive calculations whenever a change is made to part of the character). For this reason, it is NOT recommended to increase the memory to the app -- that just moves the problem over the CPU.

Midhir
Apr 14th, '09, 04:54 AM
There is a file in the HeroDesigner root directory called "runHD.bat". Edit the file with notepad adding the following two switches

-Xmx128m (sets the max available memory, this can should not be set any higher then half the ram you have in your computer, 128 will double what HD currently has available)

-Xms64m (this should be set to half the value of the -Xmx switch)

the line should look like this

javaw -Xmx128m -Xms64m -jar HDv3.jar

Then just use the batch file to launch HD.

dropblack
Apr 14th, '09, 09:19 AM
Thanks for the responses--


There is a file in the HeroDesigner root directory called "runHD.bat". Edit the file with notepad adding the following two switches

-Xmx128m (sets the max available memory, this can should not be set any higher then half the ram you have in your computer, 128 will double what HD currently has available)

-Xms64m (this should be set to half the value of the -Xmx switch)

the line should look like this

javaw -Xmx128m -Xms64m -jar HDv3.jar

Then just use the batch file to launch HD.



I've got a GB of Ram-- do you still think I need to make this adjustment? This wasn't a problem before. I'm hesitant, as these technological devices confuse and scare me :) Historically, when I tinker, I destroy... I guess the worst case scenario is that I just reinstall.

eternal_sage
Apr 14th, '09, 10:58 AM
hmm. interesting. when i use HD on linux (using the OpenJDK version of Java, btw, the regular version has the same limitations as the Windows version), then i end up with 508M available (as opposed to the 64M available under the standard Java or under Java for Windows).

any clue as to whats up with that? not that it really matters, as Linux is my perfered OS, and OpenJDK is my perfered Java implementation, so its no big deal either way. i'm just curious, and this thread reminded me of that. :D

Midhir
Apr 14th, '09, 11:19 AM
It's a limitation placed on the app by Java itself. All java apps under windows using the standard Java install are limited to 64mb unless you specifically tell Java it can use more.

dropblack
Apr 14th, '09, 01:44 PM
I've tried to change the runHD.bat file but am coming up against a few problems--

I can't seem to open it in Note Pad (unless I choose 'All Files' in the "Files of Type:" tab of the open dialogue box (of Note Pad), in which case I find the following:

cd C:\Program Files\Hero Designer
javaw -jar HDv3.jar

But if I just double click on the file it opens (with the rest of the software), providing a black field with the following type:

C:\Program Files\Hero Designer>cd C:\Program Files\Hero Designer
C:\Program Files\Hero Designer>javaw -jar HDv3.jar

I tried uninstalling and reinstalling it still drops my prefabs (they're the ones off of the Hero Designer download page).

I'm not sure where to go from here... help?

Simon
Apr 14th, '09, 03:04 PM
Might make sense to listen to what the guy who wrote the program told you (hint: it was the first response to your post).

dropblack
Apr 14th, '09, 03:22 PM
So when you say 'open' you mean currently loaded? I'm going in again right now, and will try to load a single prefab and see what happens...

Simon
Apr 14th, '09, 03:24 PM
If you run into low memory with a single prefab loaded, then:

a) post the prefab in question (if it's from a licensed product, then send me an email with the name of the prefab and the product that it's from)

b) post your trace.log file (in your installation directory) after the problem occurs but before you restart HD

Midhir
Apr 15th, '09, 04:39 AM
Since it is a .bat file you should just be able to right click the file in Explorer file browser and select Edit.

It will launch it into notepad for editing.

Then just add the two switches to the java line.

Then save it and double click the runHD.bat file to start HD.

It will open a command line window (since your running a DOS batch file to start HD) then HD will start and you should see the increased memory in the lower right hand corner of the HD screen.

Edited to add another option:
If you don't like running HD through a batch file and having a command window open (I know I don't) I found this option posted earlier about the same issue.

1. Just right click on your HD shortcut in windows and select PROPERTIES.
2. In the TARGET box paste this over the command that calls HDv3.jar

javaw.exe -Xmx128m -Xms64m -jar HDv3.jar

3. Windows will automatically find the path to javaw and add the directory in front of the command.
4. -Xmx128m is the maximum memory you want HD to use and -Xms64m should be set to half of the -Xmx value. It is not recommended to set it to more then half the available ram you have in your system.

The above settings will double what HD can use now. As noted by Simon this may cause your CPU to "churn" more as it has to do a lot more calculating when you have open more then the recommended amount of prefabs. I'm running an Intel Core2 Duo CPU @2.66Ghz with 2Gb of ram and set my memory allocation to 512m max and have never seen any noticeable CPU or overall PC slowdown. Your millage may vary.

Simon I understand you are the creator of the software but I use other java apps (KloogeWerks & HCS) that recognize the fact that you need to increase the memory allocation to run in certain circumstances. If someone who purchased the right to use your software wants to have 6 characters open and bunch of prefabs and the only thing stopping him from doing that is increasing the memory for java, exactly what is the problem? I use HD during my gaming session to reference back to the characters playing (6 total) and I like to keep a couple prefabs open (weapons, armor, spells, equipment & some odds and ends). With the 64mb limit that wasn't possible. I don't care if the burden then goes to the CPU because it is woefully under utilized anyways.

The software was created for people to use and like it or not people are going to want to do things their way. HD has been wonderfully written to allow so much customization I just don't understand why allowing it to use a little more memory is such an issue with you.

Simon
Apr 15th, '09, 04:52 AM
Hmmm....let me think.....Nope, no need. I've been through it all before. You didn't listen then, it's unlikely that you're going to listen now.

For the rest of folks listening in:

HD was optimized around the 64MB default. Having multiple characters open at once isn't a problem (only the active character takes up much space in memory). Having a large (and I do mean large) number of prefab abilities loaded (either in several large prefabs or a lot of small prefabs -- doesn't matter) does make a difference -- HD has to track each and every ability in each loaded prefab as if it were already a part of the character. That takes up space in memory.....and increasing the memory to allow more abilities to be loaded creates quite a bit of churn on the CPU.

Most folks get ticked off when their CPU churns (slowing other apps down). Not everyone has the same system -- what may work acceptably on one system causes everything (including the mouse) to lag on another. The default settings for HD are designed for everyone. They work just fine. If you are running into problems with memory, chances are likely that you are not understanding how to properly use the application.

It's akin to complaining about the gas mileage on your car and having the suggested solution be to put on a larger gas tank. It may make just a bit more sense to alter the way you drive to help maximize the fuel efficiency.

Midhir
Apr 15th, '09, 05:17 AM
You ever notice vehicles that get crappy gas mileage usually have larger gas tanks or even two gas tanks? When your gas mileage is crappy because you have to use your vehicle like say a tractor trailer to haul large loads across country you don't want to have to stop every 10 minutes to fill up or tell your customer, "sorry I can't bring all of it with me, I'll have to make 2 or 3 trips. The guy that sold me the truck told me not to fill the tanks up more then half way."

Simon
Apr 15th, '09, 05:32 AM
As I said...

Grog
Apr 27th, '09, 12:31 PM
Midhir,

Thank you so much for your posts with this memory problem. I searched for solutions a few months back and found Simon’s advice about reduce the number of prefabs that you have open at any given time -- opening and closing them as needed. That reduced the number of “Low Memory, better save and restart” popups by about 90%.

That was an improvement, but it didn’t mesh well with my personal preferences for using HD. Having multiple prefabs open at once is very handy for my particular setup, and opening and closing them on demand was annoying and inconvenient. (Again, perhaps only for me or people with similar usage desires.) And as I said even micromanaging the prefabs the “Low Memory, recommend you save and restart soon” still came up multiple times each session. For this reason alone, I was beginning to hate HD and dread long sessions with it. And that’s just wrong, because HD is an otherwise outstanding piece of software that has brought great joy to Hero gamers the world over!

The good news is, your memory fix works wonderfully for me. I understand that the CPU now has a much greater burden, but in my particular case I haven’t noticed even a smidge of lag, and HD is as spritely and responsive as I could ever hope for!

Being able to leave all my prefabs open and never getting that annoying Low Memory popup has made using HD a delight once again. You were very clear that your suggestion might not have worked out for me, but as it did work wonderfully I am extremely grateful for your post which gave me another option to try.

Thank you kindly Midhir!

Midhir
Apr 28th, '09, 05:00 AM
Glad it helped. I found the information in a previous post when someone had similar issues so I was just passing it along with a few options I added to the fix.

Scubba
Apr 28th, '09, 11:48 AM
"spritely and responsive" sounds awfully good to me. I'm glad that Grog found an answer that encourages him to run HD and purchase future upgrades.

secretID
May 11th, '09, 06:34 AM
For Simon's info:

I regularly have this problem with only one or two prefabs open. It usually goes away when I dump them.

Lately, I've been getting something else - getting the message every several seconds, even with no prefabs open. The character is unusually complex, but certainly no Destroyer.

Checking in here and seeing your response, I decided just to close and open, but all I've done is crash it.

Hmm...restarted it, and it seems OK. Anyway, I do encounter the problem a lot, though I really don't do much with prefabs.

Simon
May 11th, '09, 06:48 AM
For Simon's info:

I regularly have this problem with only one or two prefabs open. It usually goes away when I dump them.

Lately, I've been getting something else - getting the message every several seconds, even with no prefabs open. The character is unusually complex, but certainly no Destroyer.

Checking in here and seeing your response, I decided just to close and open, but all I've done is crash it.

Hmm...restarted it, and it seems OK. Anyway, I do encounter the problem a lot, though I really don't do much with prefabs.
The other reason not to increase the memory: it masks underlying problems on the system.


Try uninstalling and re-installing Java (you can get the installer at http://java.sun.com/javase/downloads/?intcmp=1281).

I've seen the problem before when Java gets a bit horked on the system (starts chewing up the memory and not garbage collecting obsolete/unreferenced objects).

brichter
Jun 27th, '11, 05:29 PM
Does HD v 6 use the RunHD.bat file as well?