This question is answered. Helpful answers available: 0. Correct answers available: 1.


Permlink Replies: 28 - Pages: 2 [ 1 2 | Next ] - Last Post: 1 Mar 21, 22:46 Last Post By: JeffTucker
linuxrog

Posts: 259
Registered: 21-Nov-2008
Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 20:34
 
  Click to reply to this thread Reply
Having problems with Java heap error. It occurs when Making a large album. Interestingly, If I F9 repeated, the Make proceeds further before terminating with the error. After serveral rides down that lane, there was success.

Jeff talked about the problem here. BUT, I can not find the file containing this variable on my Linux PC. In particular, no file JAlbum.cfg can be found. FWIW, I have increased the number of threads (Tools > Preferences > Number of threads).

So, on Linux, where is the magic file containg the Xmx setting? I assume there's not an option under Tools, Prefs, etc.

Thanks.

/Roger
JeffTucker

Posts: 8,173
Registered: 31-Jan-2006
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 20:49   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
First, the jAlbum.cfg file is found on macOS, not Linux. Do you have a jAlbum.desktop file, instead?

And to reduce the amount of RAM needed, you should reduce the number of threads used, not increase it.
linuxrog

Posts: 259
Registered: 21-Nov-2008
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 21:03   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
First, the jAlbum.cfg file is found on macOS, not Linux. Do you have a jAlbum.desktop file, instead?

And to reduce the amount of RAM needed, you should reduce the number of threads used, not increase it.


Oh, yeah: I looked for that file too. Non-existent. I did a broad search, in /home as well as other, system locations. I have been down this road before. I want to tune a bit. Had found what I thought was sweet spot with the number of threads and increasing Xmx. I have 16 GB of ram. I thought I'd increased Xmx to 12 Gb but now can not find that.
RobM

Posts: 4,188
Registered: 4-Aug-2006
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 21:45   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
linuxrog wrote:
JeffTucker wrote:
First, the jAlbum.cfg file is found on macOS, not Linux. Do you have a jAlbum.desktop file, instead?

And to reduce the amount of RAM needed, you should reduce the number of threads used, not increase it.

Oh, yeah: I looked for that file too. Non-existent.

Did you check
/usr/share/applications/Jalbum.desktop
linuxrog

Posts: 259
Registered: 21-Nov-2008
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 22:06   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
RobM wrote:
Did you check
/usr/share/applications/Jalbum.desktop

I looked high and low. Nada. Only the executable is in that directory.
RobM

Posts: 4,188
Registered: 4-Aug-2006
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 22:10   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
Maybe try the invocation command, with Xmx, as shown here
linuxrog

Posts: 259
Registered: 21-Nov-2008
Re: Java heap space error / -Xmx value / Linux
Posted: 11 Feb 21, 22:19   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Whoa! That's getting in way over my head!!

Don't understand java, etc. I'll live with what I have unless there is a "java file " that I could edit directly.

P.S. I'll give up on this unless you really want to beat on this horse.
jimberry

Posts: 581
Registered: 30-Aug-2004
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 00:00   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
linuxrog wrote:
So, on Linux, where is the magic file containg the Xmx setting? I assume there's not an option under Tools, Prefs, etc.
On my Ubuntu linux, the jAlbum.desktop file is at Home/.local/share/applications/jAlbum.desktop
although it doesn't contain a setting for Xmx which possibly means that you can add the Xmx line to change an implied default value

ETA - My mistake - in fact there are two (different) versions of jAlbum.desktop on my Ubuntu computer. Maybe one is a leftover from an older version of jAlbum.
I haven't yet established which one is used by the current version of jAlbum.

One contains the line -
Exec=jAlbum %f

The other contains -
Exec=/usr/lib/jalbum/jre64/bin/java -Xmx1200m -DuseDesktop=true -jar /usr/lib/jalbum/JAlbum.jar

Edited by: jimberry on 12-Feb-2021 20:54
jimberry

Posts: 581
Registered: 30-Aug-2004
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 00:51   in response to: jimberry in response to: jimberry
 
  Click to reply to this thread Reply
By the way, is it because of a linux or java constraint or a jAlbum quirk that this "jAlbum.desktop" file is hidden away in "Home/.local/share/applications" rather than in "Home/.jalbum" where it would be easily accessible from the program via through "Tools>Open directories>Config directory" or "CTRL C" ? :)
davidekholm

Posts: 4,064
Registered: 18-Oct-2002
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 09:52   in response to: jimberry in response to: jimberry
Helpful
  Click to reply to this thread Reply
jimberry wrote:
By the way, is it because of a linux or java constraint or a jAlbum quirk that this "jAlbum.desktop" file is hidden away in "Home/.local/share/applications" rather than in "Home/.jalbum" where it would be easily accessible from the program via through "Tools>Open directories>Config directory" or "CTRL C" ? :)

I just used the defaults of a packaging script and modified it to jAlbum. The Jalbum.desktop file should be located under /usr/share/applications/Jalbum.desktop though. Isn't that the standard location for apps? I see many .desktop files there.

Edited by: davidekholm on 12-Feb-2021 10:06
linuxrog

Posts: 259
Registered: 21-Nov-2008
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 20:36   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
jimberry wrote:
By the way, is it because of a linux or java constraint or a jAlbum quirk that this "jAlbum.desktop" file is hidden away in "Home/.local/share/applications" rather than in "Home/.jalbum" where it would be easily accessible from the program via through "Tools>Open directories>Config directory" or "CTRL C" ? :)

I just used the defaults of a packaging script and modified it to jAlbum. The Jalbum.desktop file should be located under /usr/share/applications/Jalbum.desktop though. Isn't that the standard location for apps? I see many .desktop files there.

Edited by: davidekholm on 12-Feb-2021 10:06


Jimberry and David:

I updated to Version 23.2 and systematically looked thru the various comments from jimberry starting with 12-Feb-2021 0051

jAlbum.desktop" is not in Home/.local/share/applications/

I puzzled over the *Exec . . ." comment and went on.

I think that David's comment led me path to success: It led back to seaching but I did NOT find Jalbum.desktop but a file named jAlbum in /usr/share/applications. Out of curiosity, I looked inside and found THAT file includes an Exec= line with the string -Xmx1200m. (It will probably take sudo authority to edit that.)

I recall having previously set Xmx to a much greater value, probably 12G. Thus, it appears that may have been "disappered" during an update? And, explains why I was getting heap over flow errors.

So, maybe two issues?
1. Overwriting / "disappearing" setting for Xmx
2. Confusion: The file jAlbum has no extension. Interestingly, the file name, in the top bar of my text editors, does show as jalbum.desktop. I guess this explains why I never found a file named Jalbum.desktop with deep searches that turned up nada.

Being cautious, I'll wait for feedback before editing the file I assume that if I want to set aside gigabytes, the suffix should be "G" and not "Gb". FWIW, only <4Gb of ram is used even with mutiple apps running - jAlbum, Firefox, The GIMP, etc.
JeffTucker

Posts: 8,173
Registered: 31-Jan-2006
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 21:35   in response to: linuxrog in response to: linuxrog
 
  Click to reply to this thread Reply
Something is doing you the "favor" of hiding the file extension. macOS does that if you don't tell it otherwise, much as Windows hides all kinds of system files, all in the name of keeping curious non-techies away from them. So yes, that's the file you want to edit.

Now, to the -Xmx value. It's always expressed as megabytes, so 4000M is 4Gb. It might recognize a "G," but no reason to get fancy about it. Second, 12Gb is a massive amount - it's hard to imagine jAlbum ever needing that much, unless you're processing some humongous panoramas shot with a camera with a 100 megapixel sensor. The default in the jAlbum distribution is 4000M. That should be more than enough to keep you from running into the heap space error. On the other hand, I can well imagine your current setting of 1200M not being enough if you're dealing with today's oversized digital originals.
linuxrog

Posts: 259
Registered: 21-Nov-2008
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 22:31   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
JeffTucker wrote:
Something is doing you the "favor" of hiding the file extension. macOS does that if you don't tell it otherwise, much as Windows hides all kinds of system files, all in the name of keeping curious non-techies away from them. So yes, that's the file you want to edit.

No "hidden" files in the subject directory. The files have no extensions! LInux "hides" files as "dot" files, like .this.file.ext and options in file managers turn on / off viewing them. Config files and folders in /home are so named.

Now, to the -Xmx value. It's always expressed as megabytes, so 4000M is 4Gb. It might recognize a "G," but no reason to get fancy about it. Second, 12Gb is a massive amount - it's hard to imagine jAlbum ever needing that much, unless you're processing some humongous panoramas shot with a camera with a 100 megapixel sensor. The default in the jAlbum distribution is 4000M. That should be more than enough to keep you from running into the heap space error. On the other hand, I can well imagine your current setting of 1200M not being enough if you're dealing with today's oversized digital originals.

Well, something else screwy is happening to cause heap overflow errors! This time I monitored ram usage during a forced remake. The error pops up at about 6 Gb of useage even tho I set Xmx much greater. BUT, it only took a second MAKE to finish the job. Now I've gotta poke around on my end! FWIW, the album folder properties say 8.9 Gb, 1155 items. Not all of those are image files; a few are raw .ARW files and Gimp .xcf files that I keep in the same folders but don't show in albums; I also "exclude" them. Perhaps they are clogging the pipes?

Thanks for getting me this far.
JeffTucker

Posts: 8,173
Registered: 31-Jan-2006
Re: Java heap space error / -Xmx value / Linux
Posted: 12 Feb 21, 22:42   in response to: linuxrog in response to: linuxrog
Helpful
  Click to reply to this thread Reply
linuxrog wrote:
The file jAlbum has no extension. Interestingly, the file name, in the top bar of my text editors, does show as jalbum.desktop.

That tells the story. The file does have an extension, and it's .desktop. Did you think the text editor was inventing an extension for the file, all on its own?

FWIW, the album folder properties say 8.9 Gb, 1155 items.

Tough to imagine why that would be a problem. I've got an album of family photos and videos in which the image directory (just the input side) is 28.9Gb, 5588 objects, and I've never run out of heap space when building it.
davidekholm

Posts: 4,064
Registered: 18-Oct-2002
Re: Java heap space error / -Xmx value / Linux
Posted: 13 Feb 21, 19:07   in response to: JeffTucker in response to: JeffTucker
 
  Click to reply to this thread Reply
See if adding -Dsubsampling=2 to the startup arguments helps reduce the RAM usage. This is a clever way to avoid causing too much RAM usage when reading huge files by skipping every 2:nd pixel during reading.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums