Hi All,
I'm trying to import few of the ImageJ classes to use within matlab. Matlab has great java support which basically means that I can create objects on the command line (e.g. stk=imp.createEmptyStack();). However, the maximal memory allocation is too low. Since I'm running on a OS-X with 64-bit and lots of memory I want to increase the maximal memory allocation. I already don't so in the standalone ImageJ64 application and it works great. Here is the matlab code I'm using: javaaddpath /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar import ij.*; mem=ij.plugin.Memory; mem.run(''); Than I get the menu in which I change the total memory but.... I get the following message: ImageJ is unable to change the memory limit. For more information, refer to the installation notes at http://rsb.info.nih.gov/ij/docs/install/ The ImageJ application (ImageJ.app) was not found. Current limit: 189MB Since the java objects are created within matlab its not my job to worry about memory management but matlab's problem. Is there another way to increase the limit or just disable the memory limit altogether? Thanks, Roy |
Hi Roy,
> I'm trying to import few of the ImageJ classes to use within matlab. > > Since the java objects are created within matlab its not my job to > worry about memory management but matlab's problem. Is there another > way to increase the limit or just disable the memory limit altogether? It is matlab's problem indeed. There is a long write up at the mathworks about how to set the JVM memory limit: http://www.mathworks.com/support/solutions/en/data/1-18I2C/index.html Best, Nico |
In reply to this post by Roy Wollman
I am doing particle recognition and tracking of images on high speed videos. I break the hs video up into images, then load the image sequence into ImageJ.
I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a sequence of 50,000 image files, but I get a memory error after it loads about 40,000. The total combined size of all of the 50,000 images is 20 GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ as 50 GB. So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors when I try to load 20 GB of images ? ImageJ is an excellent code for cell/particle analysis, so I want to continue using it. Thank you all for building ImageJ! Frank Shaffer Research Engineer, National Energy Technology Laboratory, US. [hidden email] >>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> Hi All, I'm trying to import few of the ImageJ classes to use within matlab. Matlab has great java support which basically means that I can create objects on the command line (e.g. stk=imp.createEmptyStack();). However, the maximal memory allocation is too low. Since I'm running on a OS-X with 64-bit and lots of memory I want to increase the maximal memory allocation. I already don't so in the standalone ImageJ64 application and it works great. Here is the matlab code I'm using: javaaddpath /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar import ij.*; mem=ij.plugin.Memory; mem.run(''); Than I get the menu in which I change the total memory but.... I get the following message: ImageJ is unable to change the memory limit. For more information, refer to the installation notes at http://rsb.info.nih.gov/ij/docs/install/ The ImageJ application (ImageJ.app) was not found. Current limit: 189MB Since the java objects are created within matlab its not my job to worry about memory management but matlab's problem. Is there another way to increase the limit or just disable the memory limit altogether? Thanks, Roy |
Franklin,
Size of image is different from size of image stored in the memory. JPEG image size is much smaller than TIFF, but when it is loaded to memory, it is same as TIFF file. In your application, I wonder if you close images once you are done with those image. Just use close(), then your computer could free up the space. Hopefully it helps. Zhengyu Dr. Zhengyu Pang Biochemistry and Biological Engineering Laboratory General Electric Company Global Research GE Imagination at work -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Franklin Shaffer Sent: Friday, December 11, 2009 9:12 AM To: [hidden email] Subject: what is real max memory limit of ImageJ ? I am doing particle recognition and tracking of images on high speed videos. I break the hs video up into images, then load the image sequence into ImageJ. I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a sequence of 50,000 image files, but I get a memory error after it loads about 40,000. The total combined size of all of the 50,000 images is 20 GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ as 50 GB. So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors when I try to load 20 GB of images ? ImageJ is an excellent code for cell/particle analysis, so I want to continue using it. Thank you all for building ImageJ! Frank Shaffer Research Engineer, National Energy Technology Laboratory, US. [hidden email] >>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> Hi All, I'm trying to import few of the ImageJ classes to use within matlab. Matlab has great java support which basically means that I can create objects on the command line (e.g. stk=imp.createEmptyStack();). However, the maximal memory allocation is too low. Since I'm running on a OS-X with 64-bit and lots of memory I want to increase the maximal memory allocation. I already don't so in the standalone ImageJ64 application and it works great. Here is the matlab code I'm using: javaaddpath /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar import ij.*; mem=ij.plugin.Memory; mem.run(''); Than I get the menu in which I change the total memory but.... I get the following message: ImageJ is unable to change the memory limit. For more information, refer to the installation notes at http://rsb.info.nih.gov/ij/docs/install/ The ImageJ application (ImageJ.app) was not found. Current limit: 189MB Since the java objects are created within matlab its not my job to worry about memory management but matlab's problem. Is there another way to increase the limit or just disable the memory limit altogether? Thanks, Roy |
I have to point out that the jvm from sun (on windows, I didn't check on
linux) has a small limitation of memory on multi core/cpu systems. On my dual core cpu in my laptop with 8 GB of RAM, I am able to start ImageJ with the option -Xmx5000m but when trying to allocate a volume of 4 GB I have an out of memory error. It seems that the jvm from sun is dividing actual RAM memory by the number of cores. Would it be possible to other people to test this issue? Trying BEA jvm (jrockit) allowed me some time ago to solve this problem. Actually I mostly use virtual stack to open very big dataset, so it not a problem from my part to use the jvm from sun. Regards, Cédric ---------------------------------------------------------- Cédric MESSAOUDI Institut Curie - INSERM U759 Laboratoire d'Imagerie Intégrative Bât 112, Centre Universitaire d'Orsay 91405 Orsay CEDEX France ---------------------------------------------------------- [hidden email] ---------------------------------------------------------- -----Message d'origine----- De : ImageJ Interest Group [mailto:[hidden email]] De la part de Pang, Zhengyu (GE, Research) Envoyé : vendredi 11 décembre 2009 15:44 À : [hidden email] Objet : Re: what is real max memory limit of ImageJ ? Franklin, Size of image is different from size of image stored in the memory. JPEG image size is much smaller than TIFF, but when it is loaded to memory, it is same as TIFF file. In your application, I wonder if you close images once you are done with those image. Just use close(), then your computer could free up the space. Hopefully it helps. Zhengyu Dr. Zhengyu Pang Biochemistry and Biological Engineering Laboratory General Electric Company Global Research GE Imagination at work -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Franklin Shaffer Sent: Friday, December 11, 2009 9:12 AM To: [hidden email] Subject: what is real max memory limit of ImageJ ? I am doing particle recognition and tracking of images on high speed videos. I break the hs video up into images, then load the image sequence into ImageJ. I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a sequence of 50,000 image files, but I get a memory error after it loads about 40,000. The total combined size of all of the 50,000 images is 20 GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ as 50 GB. So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors when I try to load 20 GB of images ? ImageJ is an excellent code for cell/particle analysis, so I want to continue using it. Thank you all for building ImageJ! Frank Shaffer Research Engineer, National Energy Technology Laboratory, US. [hidden email] >>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> Hi All, I'm trying to import few of the ImageJ classes to use within matlab. Matlab has great java support which basically means that I can create objects on the command line (e.g. stk=imp.createEmptyStack();). However, the maximal memory allocation is too low. Since I'm running on a OS-X with 64-bit and lots of memory I want to increase the maximal memory allocation. I already don't so in the standalone ImageJ64 application and it works great. Here is the matlab code I'm using: javaaddpath /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar import ij.*; mem=ij.plugin.Memory; mem.run(''); Than I get the menu in which I change the total memory but.... I get the following message: ImageJ is unable to change the memory limit. For more information, refer to the installation notes at http://rsb.info.nih.gov/ij/docs/install/ The ImageJ application (ImageJ.app) was not found. Current limit: 189MB Since the java objects are created within matlab its not my job to worry about memory management but matlab's problem. Is there another way to increase the limit or just disable the memory limit altogether? Thanks, Roy |
Hi Cedric,
I have a 4-core system with 8 Gb of RAM, I have allocated like you 5Gb for java, I can create a 4.5 Gb image. Of course I'm on linux, with sun java 1.6. a bientot Thomas Cédric Messaoudi a écrit : > I have to point out that the jvm from sun (on windows, I didn't check on > linux) has a small limitation of memory on multi core/cpu systems. > > On my dual core cpu in my laptop with 8 GB of RAM, I am able to start ImageJ > with the option -Xmx5000m but when trying to allocate a volume of 4 GB I > have an out of memory error. It seems that the jvm from sun is dividing > actual RAM memory by the number of cores. Would it be possible to other > people to test this issue? > Trying BEA jvm (jrockit) allowed me some time ago to solve this problem. > Actually I mostly use virtual stack to open very big dataset, so it not a > problem from my part to use the jvm from sun. > > Regards, > Cédric > > > > ---------------------------------------------------------- > Cédric MESSAOUDI > Institut Curie - INSERM U759 Laboratoire d'Imagerie Intégrative > Bât 112, Centre Universitaire d'Orsay > 91405 Orsay CEDEX > France > ---------------------------------------------------------- > [hidden email] > ---------------------------------------------------------- > > > > -----Message d'origine----- > De : ImageJ Interest Group [mailto:[hidden email]] De la part de Pang, > Zhengyu (GE, Research) > Envoyé : vendredi 11 décembre 2009 15:44 > À : [hidden email] > Objet : Re: what is real max memory limit of ImageJ ? > > Franklin, > > Size of image is different from size of image stored in the memory. JPEG > image size is much smaller than TIFF, but when it is loaded to memory, > it is same as TIFF file. > > In your application, I wonder if you close images once you are done with > those image. Just use close(), then your computer could free up the > space. > > Hopefully it helps. > > Zhengyu > > > Dr. Zhengyu Pang > Biochemistry and Biological Engineering Laboratory > General Electric Company Global Research > > GE Imagination at work > > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of > Franklin Shaffer > Sent: Friday, December 11, 2009 9:12 AM > To: [hidden email] > Subject: what is real max memory limit of ImageJ ? > > I am doing particle recognition and tracking of images on high speed > videos. I break the hs video up into images, then load the image > sequence into ImageJ. > > I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a > sequence of 50,000 image files, but I get a memory error after it loads > about 40,000. The total combined size of all of the 50,000 images is 20 > GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ > as 50 GB. > > So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors > when I try to load 20 GB of images ? > > ImageJ is an excellent code for cell/particle analysis, so I want to > continue using it. > > Thank you all for building ImageJ! > Frank Shaffer > Research Engineer, National Energy Technology Laboratory, US. > [hidden email] > >>>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> > Hi All, > > I'm trying to import few of the ImageJ classes to use within matlab. > Matlab has great java support which basically means that I can create > objects on the command line (e.g. stk=imp.createEmptyStack();). > > However, the maximal memory allocation is too low. Since I'm running on > a OS-X with 64-bit and lots of memory I want to increase the maximal > memory allocation. I already don't so in the standalone > ImageJ64 application and it works great. > > Here is the matlab code I'm using: > > javaaddpath > /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar > import ij.*; > mem=ij.plugin.Memory; > mem.run(''); > > Than I get the menu in which I change the total memory but.... I get the > following message: > > ImageJ is unable to change the memory limit. For more information, refer > to the installation notes at > > http://rsb.info.nih.gov/ij/docs/install/ > > The ImageJ application (ImageJ.app) was not found. > > Current limit: 189MB > > Since the java objects are created within matlab its not my job to worry > about memory management but matlab's problem. Is there another way to > increase the limit or just disable the memory limit altogether? > > Thanks, > Roy > > -- /**********************************************************/ Thomas Boudier, MCU Université Pierre et Marie Curie, IFR 83. Bat B 7ème étage, porte 706D, Jussieu. Tel : 01 44 27 20 13 Fax : 01 44 27 22 91 /*******************************************************/ |
I have the following; 4-core; 8GB RAM, 7GB allocated and able to handle
until 5601MB (!), but Win7 (Java 1.6). Best, Johannes Thomas Boudier schrieb: > Hi Cedric, > > I have a 4-core system with 8 Gb of RAM, I have allocated like you 5Gb > for java, I can create a 4.5 Gb image. Of course I'm on linux, with > sun java 1.6. > > a bientot > > Thomas > > > Cédric Messaoudi a écrit : >> I have to point out that the jvm from sun (on windows, I didn't check on >> linux) has a small limitation of memory on multi core/cpu systems. >> >> On my dual core cpu in my laptop with 8 GB of RAM, I am able to start >> ImageJ >> with the option -Xmx5000m but when trying to allocate a volume of 4 GB I >> have an out of memory error. It seems that the jvm from sun is dividing >> actual RAM memory by the number of cores. Would it be possible to other >> people to test this issue? >> Trying BEA jvm (jrockit) allowed me some time ago to solve this problem. >> Actually I mostly use virtual stack to open very big dataset, so it >> not a >> problem from my part to use the jvm from sun. >> >> Regards, >> Cédric >> >> >> >> ---------------------------------------------------------- >> Cédric MESSAOUDI >> Institut Curie - INSERM U759 Laboratoire d'Imagerie Intégrative >> Bât 112, Centre Universitaire d'Orsay 91405 Orsay CEDEX >> France >> ---------------------------------------------------------- >> [hidden email] >> ---------------------------------------------------------- >> >> >> >> -----Message d'origine----- >> De : ImageJ Interest Group [mailto:[hidden email]] De la part de >> Pang, >> Zhengyu (GE, Research) >> Envoyé : vendredi 11 décembre 2009 15:44 >> À : [hidden email] >> Objet : Re: what is real max memory limit of ImageJ ? >> >> Franklin, >> >> Size of image is different from size of image stored in the memory. JPEG >> image size is much smaller than TIFF, but when it is loaded to memory, >> it is same as TIFF file. >> >> In your application, I wonder if you close images once you are done with >> those image. Just use close(), then your computer could free up the >> space. >> >> Hopefully it helps. >> >> Zhengyu >> >> Dr. Zhengyu Pang >> Biochemistry and Biological Engineering Laboratory >> General Electric Company Global Research >> >> GE Imagination at work >> >> -----Original Message----- >> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of >> Franklin Shaffer >> Sent: Friday, December 11, 2009 9:12 AM >> To: [hidden email] >> Subject: what is real max memory limit of ImageJ ? >> >> I am doing particle recognition and tracking of images on high speed >> videos. I break the hs video up into images, then load the image >> sequence into ImageJ. >> >> I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a >> sequence of 50,000 image files, but I get a memory error after it loads >> about 40,000. The total combined size of all of the 50,000 images is 20 >> GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ >> as 50 GB. >> >> So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors >> when I try to load 20 GB of images ? >> >> ImageJ is an excellent code for cell/particle analysis, so I want to >> continue using it. >> >> Thank you all for building ImageJ! >> Frank Shaffer >> Research Engineer, National Energy Technology Laboratory, US. >> [hidden email] >>>>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> >> Hi All, >> >> I'm trying to import few of the ImageJ classes to use within matlab. >> Matlab has great java support which basically means that I can create >> objects on the command line (e.g. stk=imp.createEmptyStack();). >> >> However, the maximal memory allocation is too low. Since I'm running on >> a OS-X with 64-bit and lots of memory I want to increase the maximal >> memory allocation. I already don't so in the standalone >> ImageJ64 application and it works great. >> >> Here is the matlab code I'm using: >> >> javaaddpath >> /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar >> import ij.*; >> mem=ij.plugin.Memory; >> mem.run(''); >> >> Than I get the menu in which I change the total memory but.... I get the >> following message: >> >> ImageJ is unable to change the memory limit. For more information, refer >> to the installation notes at >> >> http://rsb.info.nih.gov/ij/docs/install/ >> The ImageJ application (ImageJ.app) was not found. >> >> Current limit: 189MB >> >> Since the java objects are created within matlab its not my job to worry >> about memory management but matlab's problem. Is there another way to >> increase the limit or just disable the memory limit altogether? >> >> Thanks, >> Roy >> >> > -- Mag. Johannes-P. KOCH Department of Biochemistry and Cell Biology MFPL, University of Vienna Dr. Bohrgasse 9/5 A-1030 Vienna Austria phone: 0043 1 4277 52809 fax: 0043 1 4277 9528 mail to: [hidden email] |
Hi,
Give a try to java command line argument -XX:+AggressiveHeap. It might solve the problem or make it worse. ;) At least in some Linux systems it works well. - Arttu Miettinen > I have the following; 4-core; 8GB RAM, 7GB allocated and able to handle > until 5601MB (!), but Win7 (Java 1.6). > > Best, > Johannes > > Thomas Boudier schrieb: >> Hi Cedric, >> >> I have a 4-core system with 8 Gb of RAM, I have allocated like you 5Gb >> for java, I can create a 4.5 Gb image. Of course I'm on linux, with >> sun java 1.6. >> >> a bientot >> >> Thomas >> >> >> Cédric Messaoudi a écrit : >>> I have to point out that the jvm from sun (on windows, I didn't check >>> on >>> linux) has a small limitation of memory on multi core/cpu systems. >>> >>> On my dual core cpu in my laptop with 8 GB of RAM, I am able to start >>> ImageJ >>> with the option -Xmx5000m but when trying to allocate a volume of 4 GB >>> I >>> have an out of memory error. It seems that the jvm from sun is dividing >>> actual RAM memory by the number of cores. Would it be possible to other >>> people to test this issue? >>> Trying BEA jvm (jrockit) allowed me some time ago to solve this >>> problem. >>> Actually I mostly use virtual stack to open very big dataset, so it >>> not a >>> problem from my part to use the jvm from sun. >>> >>> Regards, >>> Cédric >>> >>> >>> >>> ---------------------------------------------------------- >>> Cédric MESSAOUDI >>> Institut Curie - INSERM U759 Laboratoire d'Imagerie Intégrative >>> Bât 112, Centre Universitaire d'Orsay 91405 Orsay CEDEX >>> France >>> ---------------------------------------------------------- >>> [hidden email] >>> ---------------------------------------------------------- >>> >>> >>> >>> -----Message d'origine----- >>> De : ImageJ Interest Group [mailto:[hidden email]] De la part de >>> Pang, >>> Zhengyu (GE, Research) >>> Envoyé : vendredi 11 décembre 2009 15:44 >>> À : [hidden email] >>> Objet : Re: what is real max memory limit of ImageJ ? >>> >>> Franklin, >>> >>> Size of image is different from size of image stored in the memory. >>> JPEG >>> image size is much smaller than TIFF, but when it is loaded to memory, >>> it is same as TIFF file. >>> >>> In your application, I wonder if you close images once you are done >>> with >>> those image. Just use close(), then your computer could free up the >>> space. >>> >>> Hopefully it helps. >>> >>> Zhengyu >>> >>> Dr. Zhengyu Pang >>> Biochemistry and Biological Engineering Laboratory >>> General Electric Company Global Research >>> >>> GE Imagination at work >>> >>> -----Original Message----- >>> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of >>> Franklin Shaffer >>> Sent: Friday, December 11, 2009 9:12 AM >>> To: [hidden email] >>> Subject: what is real max memory limit of ImageJ ? >>> >>> I am doing particle recognition and tracking of images on high speed >>> videos. I break the hs video up into images, then load the image >>> sequence into ImageJ. >>> >>> I put 64 GB of RAM in a very fast PC (HP Z800). I try to load a >>> sequence of 50,000 image files, but I get a memory error after it loads >>> about 40,000. The total combined size of all of the 50,000 images is >>> 20 >>> GB. But I have 64 GB of RAM, and I have the memory limit set in ImageJ >>> as 50 GB. >>> >>> So if I tell ImageJ to use 50 GB of RAM, why is it giving memory errors >>> when I try to load 20 GB of images ? >>> >>> ImageJ is an excellent code for cell/particle analysis, so I want to >>> continue using it. >>> >>> Thank you all for building ImageJ! >>> Frank Shaffer >>> Research Engineer, National Energy Technology Laboratory, US. >>> [hidden email] >>>>>> "Roy Wollman" <[hidden email]> 10/30/2009 9:47 PM >>> >>> Hi All, >>> >>> I'm trying to import few of the ImageJ classes to use within matlab. >>> Matlab has great java support which basically means that I can create >>> objects on the command line (e.g. stk=imp.createEmptyStack();). >>> >>> However, the maximal memory allocation is too low. Since I'm running on >>> a OS-X with 64-bit and lots of memory I want to increase the maximal >>> memory allocation. I already don't so in the standalone >>> ImageJ64 application and it works great. >>> >>> Here is the matlab code I'm using: >>> >>> javaaddpath >>> /Applications/ImageJ/ImageJ64.app/Contents/Resources/Java/ij.jar >>> import ij.*; >>> mem=ij.plugin.Memory; >>> mem.run(''); >>> >>> Than I get the menu in which I change the total memory but.... I get >>> the >>> following message: >>> >>> ImageJ is unable to change the memory limit. For more information, >>> refer >>> to the installation notes at >>> >>> http://rsb.info.nih.gov/ij/docs/install/ >>> The ImageJ application (ImageJ.app) was not found. >>> >>> Current limit: 189MB >>> >>> Since the java objects are created within matlab its not my job to >>> worry >>> about memory management but matlab's problem. Is there another way to >>> increase the limit or just disable the memory limit altogether? >>> >>> Thanks, >>> Roy >>> >>> >> > > > -- > Mag. Johannes-P. KOCH > Department of Biochemistry and Cell Biology > MFPL, University of Vienna > Dr. Bohrgasse 9/5 > A-1030 Vienna > Austria > > phone: 0043 1 4277 52809 > fax: 0043 1 4277 9528 > > mail to: [hidden email] > |
In reply to this post by Franklin Shaffer-2
Like some of the other respondents here, I have 64-bit Ubuntu GNU/Linux,
dual core CPU and 8 GB RAM on my notebook, and java-6-sun (1.6.0_15). I can set a maximum amount of RAM for ImageJ of 6371 MB but if I make a new 1024 x 1024 x 1536 32-bit image with File->New, memory allocation dies after allocating 5368 MB. top shows me that java is using 7543 MB of memory. Just info for the discussion... Mike |
Hello,
I don't know about a limit in java or imagej. I use a 8 core machine on a cluster with about 128 GB of RAM. I don't use images of that size, but it worked fine for images until 80 GB. Greetings Fred |
In reply to this post by Pang, Zhengyu (GE Global Research)
Cedric,
Try this: -Xms5000m -Xmx5000m The above sets a fixed heap of 5Gb that can't be resized. Apparently, resizing the heap is an operation that can make the JVM to throw an OutOfMemoryException or worse. If you drop in -Xingc (for incremental garbage collection) then suddenly ImageJ behaves very well. Albert |
Free forum by Nabble | Edit this page |