Skip to main content

Phoneme & the -Xmx parameter

11 replies [Last post]
jldominguez
Offline
Joined: 2008-01-02
Points: 0

Hello, list. This is the command I am using to start my application:

254#"\phoneme\personal\bin\cvm.exe" -Xmx8m -Xbootclasspath/a:\install_dir\boot\boot.jar -cp "\install_dir\class\myjar.jar" -Djava.library.path="\install_dir\lib" com.company.package.Launcher language=es path="\install_dir"

I am using Davy's CAB (personal profile on Windows Mobile 5). I had problems when I tried to use a value higher than 8M for the Xmx parameter. Is there a way to assign more memory to the VM ?

Thanks,
Lucas

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jldominguez
Offline
Joined: 2008-01-02
Points: 0

I am having problems with the parameter -Xopt:useLargeMemoryArea=true. Has anyone used it successfully and has evidence that the VM has actually taken that into account? For example, let's suppose that you use "-Xmx8m" and you get an "Out of memory" error at a certain point, and if you use "-Xopt:useLargeMemoryArea=true -Xmx32m", then you don't get that memory error. Has anyone experienced something like that?

Thanks

cjplummer
Offline
Joined: 2006-10-16
Points: 0

Yes, I've used it and it works. On WinCE, each process has a 32mb virtual memory area. All code used by the app, plus the combination of all code in all dlls used by all apps, must map into this area. Also, most application memory allocations come from this area. Because of the dll issue, it is very easy to exceed the 32mb limit even if the app is pretty small and doe not use much memory.

There is also an area of memory called the "Large Memory Area" that is outside of this 32mb space. It can't be used for code, but can be used for other memory allocations. Specifying -Xopt:useLargeMemoryArea=true will cause cvm to allocate the java heap out of the Large Memory Area. This is only helpful if you are running up against the 32mb virtual memory limit and there is actual available RAM for the allocation. If you are running of of RAM before exceeding 32mb virtual memory area limit, then -Xopt:useLargeMemoryArea=true will not help.

Chris

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Hello. Can you paste here the exact command you actually used to start your app? Thanks.

cjplummer
Offline
Joined: 2006-10-16
Points: 0

> Hello. Can you paste here the exact command you
> actually used to start your app? Thanks.

I can't give you the exact command because it contains too many command line options. Can you send your exact command?

Also, try putting it in quotes:

"-Xopt:stdioPrefix=\Storage Card\,useLargeMemoryArea=true"

jldominguez
Offline
Joined: 2008-01-02
Points: 0

-Xmx not working.

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> -Xmx not working.
>

-Xms and -Xmx will set the same parameter for max heap size with the
last one overriding the previous parameter setting.

Try using -Xms by itself (don't mix it with using -Xmx also).

Ex.

-Xms16m

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

cjplummer
Offline
Joined: 2006-10-16
Points: 0

> -Xms and -Xmx will set the same parameter for max
> heap size with the
> last one overriding the previous parameter setting.

I don't believe that is true. If it is, then it is a bug. -Xms sets the starting heap size. -Xmx sets the maximum heap size. If the heap is not growable on the platform (I'm not sure about wince), then the larger of the two should be used for the (fixed) heap size.

Chris

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
>> -Xms and -Xmx will set the same parameter for max
>> heap size with the
>> last one overriding the previous parameter setting.
>>
>
> I don't believe that is true. If it is, then it is a bug. -Xms sets the starting heap size. -Xmx sets the maximum heap size. If the heap is not growable on the platform (I'm not sure about wince), then the larger of the two should be used for the (fixed) heap size.
>

Sorry, that's right. The larger of the two is used, not the last of the
two on a command line with both.

Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Yipieeeee!!!

I have finally found the way to make it work. I don't know why I insisted in putting each parameter in a different line in the options file. I saw somewhere an options file written by Davy and he was putting everything in one line. So here is the solution:

This is go_phoneme.lnk:

254#"\phoneme\personal\bin\cvm.exe" -f "\gvSIGMobile\phoneme.opt"

And this is \gvSIGMobile\phoneme.opt (no line feeds):

-Xopt:useLargeMemoryArea=true -Xmx32m -Xbootclasspath/a:\gvSIGMobile\boot\boot.jar -cp "\gvSIGMobile\class\all.jar" -Djava.library.path=\gvSIGMobile\lib es.prodevelop.gvsig.mobile.app.Launcher l=es p="\gvSIGMobile"

Thank you all !!
Lucas

cjplummer
Offline
Joined: 2006-10-16
Points: 0

Try -Xopt:useLargeMemoryArea=true. That should allow you to start using a larger -Xmx value when running on WinCE.

Chris

jldominguez
Offline
Joined: 2008-01-02
Points: 0

Thanks