Skip to main content

Windows Mobile & -Xopt:useLargeMemoryArea=true with -Xmx64m

55 replies [Last post]
yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,

The following example generates always an OutOfMemory exception.
The cvm options are : -Xopt:useLargeMemoryArea=true -Xmx64m -Xmn24m
The exception is thrown on a PDA with 256MO RAM and on WindowsMibile Emulator.

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

public void addAmount (int val)
{
amount += val;
}

public int getAmount ()
{
return amount;
}

/**
* Benchmark driver. Creates half a million of simple account
* objects, adds an amount to each one, and then computes the
* sum of all amounts in all objects.
* Reports elapsed time in milliseconds and number of objects
* processed per millisecond.
*/
public static void main (String[] args)
{
System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
}
}
}

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
billp
Offline
Joined: 2006-09-19
Points: 0

It does not make sense, unfortunately. The problem with having to back off a page right at the boundary makes no sense either. For the residual loop I tried various values using 5.x emulator image but could not get any consistent result, sometimes it would work, sometimes not. Given that this code should be used rarely in most normal circumstances doing the loop of commits with pagesize size is the safest way out. Fortunately, going forward past WinCE version >= 6.0 we won't need this hack.

bill

davyp
Offline
Joined: 2007-01-03
Points: 0

Thanks,

Yes, weird indeed, but your hack seems to work. Unfortunately, all Windows Mobile editions up to
6.5 rely on a WinCE 5.2 or older kernel and Windows Phone 7 (based on WinCE 6.0) won't allow
deploying native applications like the phoneME VM :-(.

Thanks again
Davy

billp
Offline
Joined: 2006-09-19
Points: 0

A fix for this has been committed to OSS repository. Let me know if you have any problems.

bill

davyp
Offline
Joined: 2007-01-03
Points: 0

Hi Bill,

Thanks for the commit. I was working on a simple fix myself based on your suggestions, and
was comparing what I did (a simple loop of commits of mempage size) with what you committed
in the svn repository.

I have a question about the fix you implemented. You first start checking in a while loop whether
you cross the next 32MB boundary, and you keep on committing until you no longer cross the
next 32MB boundary for the remainder of the memory that needs to be committed. For very
large heap sizes, you are committing chunks of up to 32MB-8K followed by an 8K (=mempage
size) commit at each 32MB boundary.

Later on you start committing in single mempages in case of WinCE < 600 due to some other
weird error. In the worst case this could lead to about 4000 calls of an 8K commit, but most
likely you need to commit less than 32MB, and as such less than in the first loop. So I find it
weird that the error that you are trying to cover with the second while loop does not occur in the
first while loop. Does this make sense to you?

Anyway, I am preparing some new builds and report here whether it works for me or not.

Regards
Davy

davyp
Offline
Joined: 2007-01-03
Points: 0

I did some testing on Windows Mobile 2003, Windows Mobile 6 and 6.5 with a slight modified
version of the test example above, and I can confirm success. Here is the output (from the
WM6.5 emulator):

-- maxMemory=65536 KB
-- totalMemory=24576 KB
0: totalMemory=24576 KB - freeMemory=22508 KB - maxMemory=65536 KB
25000: totalMemory=24576 KB - freeMemory=20556 KB - maxMemory=65536 KB
50000: totalMemory=24576 KB - freeMemory=18582 KB - maxMemory=65536 KB
75000: totalMemory=24576 KB - freeMemory=16600 KB - maxMemory=65536 KB
100000: totalMemory=24576 KB - freeMemory=14616 KB - maxMemory=65536 KB
125000: totalMemory=24576 KB - freeMemory=12745 KB - maxMemory=65536 KB
150000: totalMemory=24576 KB - freeMemory=10758 KB - maxMemory=65536 KB
175000: totalMemory=24576 KB - freeMemory=8772 KB - maxMemory=65536 KB
200000: totalMemory=24576 KB - freeMemory=6899 KB - maxMemory=65536 KB
225000: totalMemory=24576 KB - freeMemory=4913 KB - maxMemory=65536 KB
250000: totalMemory=24576 KB - freeMemory=2927 KB - maxMemory=65536 KB
275000: totalMemory=29380 KB - freeMemory=5744 KB - maxMemory=65536 KB
300000: totalMemory=29380 KB - freeMemory=3872 KB - maxMemory=65536 KB
325000: totalMemory=35448 KB - freeMemory=7953 KB - maxMemory=65536 KB
350000: totalMemory=35448 KB - freeMemory=5967 KB - maxMemory=65536 KB
375000: totalMemory=35448 KB - freeMemory=4094 KB - maxMemory=65536 KB
400000: totalMemory=42728 KB - freeMemory=9388 KB - maxMemory=65536 KB
425000: totalMemory=42728 KB - freeMemory=7402 KB - maxMemory=65536 KB
450000: totalMemory=42728 KB - freeMemory=5529 KB - maxMemory=65536 KB
475000: totalMemory=51224 KB - freeMemory=12039 KB - maxMemory=65536 KB
Elapsed time in milliseconds for 500000 objects: 88150
Objects per millisecond: 5
-- maxMemory=65536 KB
-- totalMemory=51224 KB

As usual, my latest builds of the phoneME port for WinCE are available at:
http://davy.preuveneers.be/phoneme/

Regards,
Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,

The test is ok on my PDA running WM 6.1

Thank you very much.

Best regards.

Hinkmond Wong

On 8/28/2010 4:57 AM, phonemeadvanced@mobileandembedded.org wrote:
> Hi,
>
> The test is ok on my PDA running WM 6.1
>
> Thank you very much.
>
> Best regards.
> [Message sent by forum member 'yhilem']

Thanks, Bill P. (btw, who is an Oracle engineer), for committing the fix
to the open source.

(For those in the open source community, please recognize that Oracle
continues to participate in the open source, contributing code, despite
what you may read from others who try to revise the truth. If you see
others in the open source commenting falsely that Oracle is not
participating in the Java open source community anymore, you can cite
this example to prove we still are)

Thanks,

Hinkmond

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

davyp
Offline
Joined: 2007-01-03
Points: 0

I am not sure what the problem is, but I have not touched the original WinCE memory
management source code for my builds.

Maybe the above debug builds don't work as they are compiled for Windows Mobile 2003 (which
is basically WinCE 4.20). According to the documentation, you should have WinCE 5.0 to
virtually allocate 4GB, but I don't know whether this is a library version issue or an OS version
issue.

http://msdn.microsoft.com/EN-US/library/aa454885.aspx#effective_memory_s...
http://msdn.microsoft.com/en-us/library/aa908768.aspx

Which non-debug builds did you try? Were they builds for WM5 or WM6?

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Davy,

The non-debug builds i have tested are the latest builds :

Windows Mobile 6 - phoneME Advanced - CDC b167
(http://davy.preuveneers.be/phoneme/public/dist/CDC-phoneme_advanced_mr2_...)

My PDA config is :

Windows Mobile 6.1 Professional
CE OS 5.2.20961
Processor : ARM920T PXA27x
Memory : 216.90 MB
StorageCard : 1GB

yhilem

Message was edited by: yhilem

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Davy and Hinkmond,

With this .lnk commande :

250#"\IPSM\phoneme\cdc\bin\cvm.exe" "-Xopt:stdioPrefix=\IPSM\MemoryTester,useConsole=true,useLargeMemoryArea=true" -Xdebug -Xmx64m -cp "\IPSM\MemoryTester" MemoryTester

I get three output files :

1) IN.txt is empty

2) OUT.txt :
-- START --
-- maxMemory=65536 KB
-- totalMemory=2048 KB
---------------------
java.lang.OutOfMemoryError: [B
at MemoryTester.main([Ljava/lang/String;)V(MemoryTester.java:13)
at sun.misc.CVM.runMain()V(CVM.java:524)
-- maxMemory=65536 KB
-- totalMemory=2048 KB
---------------------

3) ERR.txt :

CVM Configuration:
prefix for stdio files (stdioPrefix): \IPSM\MemoryTester
path for stdin (stdin):
path for stdout (stdout):
path for stderr (stderr):
VirtualAlloc in Large Memory Area (useLargeMemoryArea): true
Use Java Console (useConsole): true
Port to redirect stdout to (stdoutPort): -1
Port to redirect stderr to (stderrPort): -1
Java stack chunk size (stackChunkSize): 2048
Java stack minimum size (stackMinSize): 3072
Java stack maximum size (stackMaxSize): 131072
JIT Configuration:
Interpreter transition cost (icost): 20
Mixed transition cost (mcost): 50
Backwards branch cost (bcost): 4
Compilation threshold (climit): 20000
When to compile (compile): policy
What to inline (inline): virtual+nonvirtual+vhints+ihints
Max Inlining Depth (maxInliningDepth): 12
Max Inlining Code Length (maxInliningCodeLength): 68
Min Inlining Code Length (minInliningCodeLength): 16
Policy Triggered Decompilations (policyTriggeredDecompilations): true
Max Working Memory Size (maxWorkingMemorySize): 1048576
Max Compiled Method Size (maxCompiledMethodSize): 65535
Code Cache Size (codeCacheSize): 524288
Upper Code Cache Threshold (upperCodeCacheThreshold): 95%
Lower Code Cache Threshold (lowerCodeCacheThreshold): 90%
Pass Phi values in registers (XregisterPhis): true
Pass locals in registers between blocks (XregisterLocals): true
Compiling Causes Class Loading (XcompilingCausesClassLoading): false
Trace (trace): none
GC[SS]: Initialized semi-space gen for generational GC
Size of *each* semispace in bytes=1048576
Limits of generation = [0x5a000000,0x5a200000)
First semispace = [0x5a000000,0x5a100000)
Second semispace = [0x5a100000,0x5a200000)
Current semispace = First semispace
GC[MC]: Initialized mark-compact gen for generational GC
Size of the space in bytes=1048576
Limits of generation = [0x5a200000,0x5a300000)
GC[generational]: Sizes
youngGen = min 1048576 start 1048576 max 1048576
oldGen = min 1048576 start 1048576 max 66060288
overall = min 2097152 start 2097152 max 67108864
GC[generational]: Auxiliary data structures
heapBaseMemoryArea=[0x5a000000,0x5e100000)
cardTable=[0x5e100000,0x5e120800)
objectHeaderTable=[0x5e121000,0x5e141800)
summaryTable=[0x5e142000,0x5e1c4000)

davyp
Offline
Joined: 2007-01-03
Points: 0

I don't have access to my build machine right now, but if I have some spare time I will try to make
a debug build for Windows Mobile 6, with DEBUG_MMAP enabled in order to check whether the
VirtualAlloc memory allocations succeed or fail.

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

I have (there are more than a year) already compiled phoneme CDC Advanced for Windows Mobile 6.
However, I can no longer compile since I upgraded MS Visual Studio version 2005 to version 2008.

davyp
Offline
Joined: 2007-01-03
Points: 0

I made a debug build of CDC for Windows Mobile 6 and I can reproduce the memory allocation
issue. I get the same output as above for the MemoryTester application (-Xmx64m).

254#"\storage card\cdc6_debug\bin\cvm.exe" "-Xopt:stdioPrefix=/storage card,useConsole=true,useLargeMemoryArea=true" -Xmx64m -cp "\storage card\cdc6_debug\MemoryTester.jar" MemoryTester

-- START --
-- maxMemory=65536 KB
-- totalMemory=2048 KB
---------------------
java.lang.OutOfMemoryError: [B
at MemoryTester.main([Ljava/lang/String;)V(MemoryTester.java:13)
at sun.misc.CVM.runMain()V(CVM.java:524)
-- maxMemory=65536 KB
-- totalMemory=2048 KB
---------------------

I also enabled the DEBUG_MMAP macro to debug the memory mapping/committing/unmapping
and this produced the additional debug output lines:

CVM Configuration:
...
VirtualAlloc in Large Memory Area (useLargeMemoryArea): true
...

CVMmemMap: 0x41c4000 bytes at 0x52000000 (request: 0x41c4000 bytes)
CVMmemCommit: 0x200000 bytes at 0x52000000 (request: 0x200000 bytes at 0x52000000)
CVMmemCommit: 0x100000 bytes at 0x52200000 (request: 0x100000 bytes at 0x52200000)
CVMmemCommit: 0x21000 bytes at 0x56100000 (request: 0x21000 bytes at 0x56100000)
CVMmemCommit: 0x21000 bytes at 0x56121000 (request: 0x21000 bytes at 0x56121000)
CVMmemCommit: 0x82000 bytes at 0x56142000 (request: 0x82000 bytes at 0x56142000)
CVMmemCommit failed: (request: 0x1e56000 bytes at 0x52300000)

The last line above is actually the last line in the ERR.txt log file. This is where the 32768000
bytes are allocated in the Java code, and it is the only commit for a chunk of more than 2MB.

-If I allocate 16777216 (i.e. 16MB) rather than 32768000 bytes, the test succeeds.
-All goes well up to 29MB, but at 30MB I get the CVMmemCommit error.

I then looked if it would be possible to allocate two equal byte array chunks of 16MB, and
somehow this produces even weirder results:

CVMmemCommit: 0xf16000 bytes at 0x52300000 (request: 0xf16000 bytes at 0x52300000)
CVMmemCommit failed: (request: 0x155d000 bytes at 0x53216000)

I don't understand why for the second byte array the VM tries to allocate 22MB.
I am not sure what we can do about this.

Davy

billp
Offline
Joined: 2006-09-19
Points: 0

This appears to be a problem with committing beyond a 32MB boundary. There is some doc on MSDN for WinCE 6.x saying that if you commit through a 32MB boundary you have to do it in two chunks. Apparently, this applies to earlier WinCE versions as I'm using 5.2 on an emulator. I hacked up a fix for memory_md.c with this in mind and it now allows you to commit pages through a 32MB boundary. The test then passes.
I'll see about getting a fix committed reasonably soon.

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> This appears to be a problem with committing beyond a 32MB boundary. There is some doc on MSDN for WinCE 6.x saying that if you commit through a 32MB boundary you have to do it in two chunks. Apparently, this applies to earlier WinCE versions as I'm using 5.2 on an emulator. I hacked up a fix for memory_md.c with this in mind and it now allows you to commit pages through a 32MB boundary. The test then passes.
> I'll see about getting a fix committed reasonably soon.
>

Thanks Bill & Davy!

Hinkmond

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

davyp
Offline
Joined: 2007-01-03
Points: 0

Any chance Bill you can commit this fix to svn? Or should I go and try fixing it myself?

Thanks,
Davy

billp
Offline
Joined: 2006-09-19
Points: 0

As soon as we do an internal review I'll do a commit.

bill

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Hinkmond,

Before running the option 2,

Start -> Settings -> System -> Memory -> Main

Storage
Total : 31.92 MB
In Use : 9.90 MB
Free : 22.02 MB

Program :
Total : 216.87 MB
In Use : 33.79 MB
Free : 183.08 MB

As you can see, we have enough free memory : 183 MB

As I indicated :

in order to use shared memory, it is necessary that certain conditions are verified, for example:
requestedSize > 2 MB for the function:
void *CVMmemMap(size_t requestedSize, size_t *mappedSize)

See comments of this method in the source :
cdc \ src \ win32 \ JavaVM \ runtime \ memory_md.c

For me, It's the caller responsibility : CVM memory manager

So I think (tentatively) that it is a bug.

yhilem

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Program :
> Total : 216.87 MB
> In Use : 33.79 MB
> Free : 183.08 MB
>
>
> As you can see, we have enough free memory : 183 MB
>
> As I indicated :
>
> in order to use shared memory, it is necessary that certain conditions are verified, for example:
> requestedSize > 2 MB for the function:
> void *CVMmemMap(size_t requestedSize, size_t *mappedSize)
>
> See comments of this method in the source :
> cdc \ src \ win32 \ JavaVM \ runtime \ memory_md.c
>
> For me, It's the caller responsibility : CVM memory manager
>
> So I think (tentatively) that it is a bug.
>

Hi yhilem,

Thanks for confirming your test conditions. Yes, looks tentatively like
a bug. Let me try to reproduce the failure on my Windows Mobile device
and let you know. Might need to confer with a CVM engineer who knows
more about our Windows Mobile port here in our group for more info...

Thanks,
Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

I know this limitation of wince 5.0.
The use of this option solves the problem : I have tested this with other JVM and it works.

Moreover, it's explained in :

http://forums.java.net/jive/thread.jspa?threadID=44720
<------
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.
----->

Unless I missed something !!!!! it is a bug of cvm and not wince 5.0 :

The user space of CE 5 is divided into 32 process slots, each occupying 32 Mb of virtual memory, and a shared memory area in which any processes can allocate virtual memory.

Question : does the option useLargeMemoryArea=true allow the cvm to use the shared area?

Best regards.

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> I know this limitation of wince 5.0.
> The use of this option solves the problem : I have tested this with other JVM and it works.
>
> Moreover, it's explained in :
>
> http://forums.java.net/jive/thread.jspa?threadID=44720
> <------
> 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.
> ----->
>
> Unless I missed something !!!!! it is a bug of cvm and not wince 5.0 :
>
> The user space of CE 5 is divided into 32 process slots, each occupying 32 Mb of virtual memory, and a shared memory area in which any processes can allocate virtual memory.
>
> Question : does the option useLargeMemoryArea=true allow the cvm to use the shared area?
>
>

Hi yhilem,

Yes, the option -Xopt:useLargeMemory=true works to allow the cvm to use
the WinCE shared area to expand the available memory area and it has
been tested with the cvm which has shown it is working fine.

The problem you are seeing is probably not a cvm bug but instead a
problem with how you are trying to set the option correctly using your
Windows Mobile shortcut on your device, which incidentally can only take
256 characters and is the cause of many unrecognizable errors.

If you make a typo, use WordPad instead of NotePad (which inserts
linefeeds with the carriage returns instead of just carriage returns) or
don't use -Xopt: correctly with a comma for multiple -Xopt: settings, or
run over 256 characters in your shortcut, you will see the error you are
seeing now.

Can you send exactly what is inside your Windows Mobile shortcut (.lnk)
file and any -f extras file contents so we can see what that looks like
when you try to launch CVM?

Here is an example of how your files should look:

Create a Windows Mobile shortcut called "go_phoneme.lnk":

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

Then create a text file called \gvSIGMobile\phoneme.opt (no line feeds)
on your device:

-Xopt:useLargeMemoryArea=true -Xms128m
-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"

Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Hinkmond,
Thank you for your help.

The shotcut content is :
250#"\IPSM\phoneme\personal\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xms128m -cp "\IPSM\benchmark-02" PerformanceTester

With -Xms128m, the cvm doesn't start
With -Xms28m, the cvm starts but throws OutofMemoryException

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

public void addAmount (int val)
{
amount += val;
}

public int getAmount ()
{
return amount;
}

/**
* Benchmark driver. Creates half a million of simple account
* objects, adds an amount to each one, and then computes the
* sum of all amounts in all objects.
* Reports elapsed time in milliseconds and number of objects
* processed per millisecond.
*/
public static void main (String[] args)
{
System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
//try {Thread.currentThread().sleep(30*1000);} catch (Exception ie) {}
}
}
}

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
> Thank you for your help.
>
> The shotcut content is :
> 250#"\IPSM\phoneme\personal\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xms128m -cp "\IPSM\benchmark-02" PerformanceTester
>
> With -Xms128m, the cvm doesn't start
> With -Xms28m, the cvm starts but throws OutofMemoryException
>

Let's just focus on the -Xms28m throws OutOfMemoryException first.
Using the debug build, which exact line of source code throws the OOM
Exception?

Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

Sorry I haven't a debug build.

I have downloaded the builds from davyp web site : http://davy.preuveneers.be/phoneme/?q=node/10

Best regards.

davyp
Offline
Joined: 2007-01-03
Points: 0

I found some debug builds on my system. Note that were compiled for Windows Mobile 2003, but
I think they will work for WM5 and higher too.

http://davy.preuveneers.be/phoneme/public/dist/debug/index.html

Hope this helps.

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Davy,
Thank you. I have downloaded the debug version.

With the .lnk script :
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xms28m -cp "\IPSM\benchmark-02" PerformanceTester

The Java console contains :

-- START --
-- maxMemory=28672 KB
-- totalMemory=28672 KB
Could not allocate exception object "java.lang.OutOfMemoryError"; throwing a pre-allocated OutOfMemoryError object instead
-------------------------------
java.lang.OutOfMemoryError
-- maxMemory=28672 KB
-- totalMemory=2048 KB
-------------------------------
-- maxMemory=28672 KB
-- totalMemory=2048 KB

Best regards

Best regards.

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Davy,
> Thank you. I have downloaded the debug version.
>
> With the .lnk script :
> 250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xms28m -cp "\IPSM\benchmark-02" PerformanceTester
>
> The Java console contains :
>
> -- START --
> -- maxMemory=28672 KB
> -- totalMemory=28672 KB
> Could not allocate exception object "java.lang.OutOfMemoryError"; throwing a pre-allocated OutOfMemoryError object instead
> -------------------------------
> java.lang.OutOfMemoryError

Hi yhilem,

We need to see more of your source code, especially the rest of this try
block (which looks to me that inside this try block, it is probably
trying to allocate multiple Java objects that in total add up to more
than 28MB of memory that is available to your program):

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr/ =]]/

// What comes after your for-statement above?

Please post all the source code of that try block all the way to your
catch statement.

Thanks,
Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

public void addAmount (int val)
{
amount += val;
}

public int getAmount ()
{
return amount;
}

/**
* Benchmark driver. Creates half a million of simple account
* objects, adds an amount to each one, and then computes the
* sum of all amounts in all objects.
* Reports elapsed time in milliseconds and number of objects
* processed per millisecond.
*/
public static void main (String[] args)
{
System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
//try {Thread.currentThread().sleep(30*1000);} catch (Exception ie) {}
}
}
}

yhilem
Offline
Joined: 2004-10-31
Points: 0

(following source code)

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
//try {Thread.currentThread().sleep(30*1000);} catch (Exception ie) {}
}
}
}

yhilem
Offline
Joined: 2004-10-31
Points: 0

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

public void addAmount (int val)
{
amount += val;
}

public int getAmount ()
{
return amount;
}

/**
* Benchmark driver. Creates half a million of simple account
* objects, adds an amount to each one, and then computes the
* sum of all amounts in all objects.
* Reports elapsed time in milliseconds and number of objects
* processed per millisecond.
*/
public static void main (String[] args)
{
System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
//try {Thread.currentThread().sleep(30*1000);} catch (Exception ie) {}
}
}
}

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Hinkmond ,

The program's objective is to allocate more than 32 MB of RAM to check if the cvm uses shared memory.

Apparently, it is not.

With this options, the cvm doesn't start :
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xm64m -cp "\IPSM\benchmark-02" PerformanceTester

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Hinkmond ,

The program's objective is to allocate more than 32 MB of RAM to check if the cvm uses shared memory.

Apparently, it is not.

With this options :
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xmx64m -cp "\IPSM\benchmark-02" PerformanceTester

The console is :

-- START --
-- maxMemory=65536 KB
-- totalMemory=2048 KB
Could not allocate exception object "java.lang.OutOfMemoryError"; throwing a pre-allocated OutOfMemoryError object instead
-------------------------------
java.lang.OutOfMemoryError
-- maxMemory=65536 KB
-- totalMemory=29988 KB

Best regards

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> The program's objective is to allocate more than 32 MB of RAM to check if the cvm uses shared memory.
>
> Apparently, it is not.
>
> With this options :
> 250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xmx64m -cp "\IPSM\benchmark-02" PerformanceTester

Hi yhilem,

Your source code does not look like it is trying to allocate only the
amount of memory that you think it should be allocating. Remember that
32MB is not actually 32,000,000 bytes since 1KB==1024 bytes and
1MB==1048576 bytes, not 1000000 bytes. Instead, the 500,000 new
PerformanceTester objects inside your ptarr[] array may be much bigger
than you think it is, and is most likely running over the 64MB max heap
size you setting using "-Xmx64m".

Instead of your PerformanceTester, try running this app instead

MemoryTester.java
---
public class MemoryTester
{
public static void main (String[] args)
{
byte[] maxByteArray;

maxByteArray = new byte[32768000];

System.out.println("Allocation of 32MB OK.");
System.out.println("Test PASSED.");
}
}

Use these options in your shortcut:
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true
-Xdebug -Xmx64m -cp "\IPSM\benchmark-02" MemoryTester

Note, with these options you should see it fail with OutOfMemoryException:
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true
-Xdebug -Xmx32m -cp "\IPSM\benchmark-02" MemoryTester

Please let me know what your results are of running the test above using
the 2 shortcut options I give above "-Xmx64m" vs. "-Xmx32m".

Thanks,
Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi Hinkmond,

The test class :

public class MemoryTester
{

public static void main (String[] args)
{
byte[] maxByteArray;

System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
maxByteArray = new byte[32768000];

System.out.println("Allocation of 32MB OK.");
System.out.println("Test PASSED.");

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
}
}

1) with the following .lnk :
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xmx32m -cp "\IPSM\MemoryTester" MemoryTester

The console is :

-- START --
-- maxMemory=32768 KB
-- totalMemory=2048 KB
-------------------------------
java.lang.OutOfMemoryError;[B
at MemoryTester.main([Ljava/lang/String;)VMemoryTester.java:13)
at sun.misc.CVM.runMain()V(CVM.java.524)
-- maxMemory=32768 KB
-- totalMemory=2048 KB
-------------------------------

2) with the following .lnk :
250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xmx64m -cp "\IPSM\MemoryTester" MemoryTester

The console is :

-- START --
-- maxMemory=65536 KB
-- totalMemory=2048 KB
-------------------------------
java.lang.OutOfMemoryError;[B
at MemoryTester.main([Ljava/lang/String;)VMemoryTester.java:13)
at sun.misc.CVM.runMain()V(CVM.java.524)
-- maxMemory=65536 KB
-- totalMemory=29988 KB
-------------------------------

Best regards.

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Hi Hinkmond,
>
> 2) with the following .lnk :
> 250#"\IPSM\phoneme\cdc\bin\cvm.exe" -Xopt:useLargeMemoryArea=true -Xdebug -Xmx64m -cp "\IPSM\MemoryTester" MemoryTester
>
> The console is :
>
> -- START --
> -- maxMemory=65536 KB
> -- totalMemory=2048 KB
> -------------------------------
> java.lang.OutOfMemoryError;[B
> at MemoryTester.main([Ljava/lang/String;)VMemoryTester.java:13)
> at sun.misc.CVM.runMain()V(CVM.java.524)
> -- maxMemory=65536 KB
> -- totalMemory=29988 KB
> -------------------------------
>

Hi yhilem,

Just before you run your option #2 (above) using -Xmx64m, on your device
that you are going to use to run, do the following first:

Start -> Settings -> Memory Info
or
Start -> Settings -> System -> Memory

For just the Memory part of that screen, what is your available/free
amount of memory and what is your used amount of memory?

Typically, a Windows Mobile device will use about 70MB of memory just to
run normal Windows Mobile native default apps and the Windows Mobile OS
environment itself. This is typical even before you start a Java app.
So, you might not actually have 64MB of available/free memory to run
your MemoryTester. If that is the case, go to your Task List and kill
some of the native running Windows Mobile apps to see if that frees
enough memory.

Hinkmond

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

yhilem
Offline
Joined: 2004-10-31
Points: 0

NO MESSAGE

Message was edited by: yhilem

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,

The code example is truncated.

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

public void addAmount (int val)
{
amount += val;
}

public int getAmount ()
{
return amount;
}

/**
* Benchmark driver. Creates half a million of simple account
* objects, adds an amount to each one, and then computes the
* sum of all amounts in all objects.
* Reports elapsed time in milliseconds and number of objects
* processed per millisecond.
*/
public static void main (String[] args)
{
System.out.println("-- START --");
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");

try {
long starttime = 0;
long endtime = 0;
int sum = 0;

starttime = System.currentTimeMillis();

PerformanceTester[] ptarr = new PerformanceTester[NOBJECTS];

for (int i = 0; i < NOBJECTS; i++)
ptarr[i] = new PerformanceTester();

for (int i = 0; i < NOBJECTS; i++)
ptarr[i].addAmount(i);

for (int i = 0; i < NOBJECTS; i++)
sum += ptarr[i].getAmount();

endtime = System.currentTimeMillis();
System.out.println ("Elapsed time in milliseconds for "
+ NOBJECTS + " objects: " + (endtime - starttime));
System.out.println ("Objects per millisecond: "
+ (NOBJECTS / (endtime - starttime)));

}
catch (Throwable e) {
System.out.println("---------------------");
e.printStackTrace(System.out);
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
System.out.println("---------------------");
}
finally {
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB");
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB");
try {System.in.read();} catch (Exception ioe) {}
}
}
}

yhilem
Offline
Joined: 2004-10-31
Points: 0
davyp
Offline
Joined: 2007-01-03
Points: 0

Not sure what is going on, but I can run the code you are referring to just fine in the emulator.
Without the extra options I too get the OutOfMemory exception, but with the extra options
(-Xopt:useLargeMemoryArea=true -Xmx64m -Xmn24m) the program runs fine. I got some 192
objects per millisecond with the CDC vm in a WM6 emulator with 128M of memory. I have not
tested on a real device though!

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,

I always have java.lang.OutOfMemoryError on Windows Mobile 6 Professional Emulator with 128 MB RAM and Foundation_Profile-phoneme_advanced_mr2_b126-win32_arm_wm6-bin-rev18926

The memory is :
At begin :
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB") ---> 65536 KB
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB") ---> 24576 KB

At end (after java.lang.OutOfMemoryError ) :
System.out.println("-- maxMemory=" + (Runtime.getRuntime().maxMemory() / 1024) + " KB") ---> 65536 KB
System.out.println("-- totalMemory=" + (Runtime.getRuntime().totalMemory() / 1024) + " KB") ---> 29384 KB

What version of Phoneme Advanced you use for your test.

In advance thank you.

davyp
Offline
Joined: 2007-01-03
Points: 0

Here are some experiments with the emulator on another slower machine with
the different profile builds of phoneme advanced:

With the CDC Build:

-- maxMemory=65536 KB
-- totalMemory=24576 KB
Elapsed time in milliseconds for 500000 objects: 4000
Objects per millisecond: 125
-- maxMemory=65536 KB
-- totalMemory=24576 KB

With the Foundation Profile build:

-- maxMemory=65536 KB
-- totalMemory=24576 KB
Elapsed time in milliseconds for 500000 objects: 4729
Objects per millisecond: 105
-- maxMemory=65536 KB
-- totalMemory=24576 KB

With the Personal Profile build:

-- maxMemory=65536 KB
-- totalMemory=24576 KB
Elapsed time in milliseconds for 500000 objects: 4713
Objects per millisecond: 106
-- maxMemory=65536 KB
-- totalMemory=24576 KB

I did some experiments with a plain Java on linux, and the test code even works
with max 10M heap space:

java -Xmx10M PerformanceTester

-- maxMemory=10176 KB
-- totalMemory=5056 KB
Elapsed time in milliseconds for 500000 objects: 480
Objects per millisecond: 1041
-- maxMemory=10176 KB
-- totalMemory=10176 KB

Basically, I don't need the full 24M that was set as minimum heap space, and
that is why the totalMemory value in the experiments with the emulator does
not change.

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Excuse me, I forgot to mention that I made the following changes to increase the consumption of memory:

public class PerformanceTester
{
private String ctime;
private int amount;
private static int NOBJECTS = 500000;

public PerformanceTester() {
ctime = "" + System.currentTimeMillis();
}

.....

davyp
Offline
Joined: 2007-01-03
Points: 0

500 000 is the value used in the online code. I presume you are using the value
5 000 000?

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

No, I added the new citme attribute initialized to currentTimeMillis in the constructor.
The line :
private static int NOBJECTS = 500000;
is unchanged.

It is sufficient for you to apply these changes to have an OutOfMemoryError (at least I think) as I've described above.

davyp
Offline
Joined: 2007-01-03
Points: 0

Right, I did not notice that.

I added some extra code in there and I get the out of memory exception after
having created about 350000 objects. Right before the exception occured,
totalMem is about 29352 KB.

At this point I remembered another Windows Mobile 5 and 6 limitation: each
process has a 32MB virtual address space. The 32MB restriction is removed
from Windows CE 6.0 on, but both Windows Mobile 5 and 6 are based on
Windows CE 5.x.

Your program is hitting that 32MB hard limit and there is nothing I can do about
that.

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Again, thanks for your feedback.

The purpose of the option useLargeMemoryArea, as I understood, is to allow a Java program to exceed the 32 MB limit imposed by Windows Mobile 5 and 6.

For more details, see cdc \ src \ win32 \ JavaVM \ runtime \ memory_md.c

However, in order to use shared memory, it is necessary that certain conditions are verified, for example:
requestedSize> 2 MB for the function:
void *CVMmemMap(size_t requestedSize, size_t *mappedSize)

It's the caller responsibility : CVM memory manager

So I think (tentatively) that it is rather a bug. Otherwise, why is this option?

davyp
Offline
Joined: 2007-01-03
Points: 0

I added some debugging statements, and the call to CVMmemMap seems to work (or at least the
call to the underlying VirtualAlloc wince method does not fail). However, when I made a build with
debugging enabled, I encountered an assert error as soon as the VM wants to allocate more than
32M of memory:

CVM Configuration:
- prefix for stdio files (stdioPrefix): /storage card
- path for stdin (stdin):
- path for stdout (stdout):
- path for stderr (stderr):
- VirtualAlloc in Large Memory Area (useLargeMemoryArea): true
- Use Java Console (useConsole): true
- Port to redirect stdout to (stdoutPort): -1
- Port to redirect stderr to (stderrPort): -1
- Java stack chunk size (stackChunkSize): 2048
- Java stack minimum size (stackMinSize): 3072
- Java stack maximum size (stackMaxSize): 131072

JIT Configuration:
- Interpreter transition cost (icost): 20
- Mixed transition cost (mcost): 50
- Backwards branch cost (bcost): 4
- Compilation threshold (climit): 20000
- When to compile (compile): policy
- What to inline (inline): virtual+nonvirtual+vhints+ihints
- Max Inlining Depth (maxInliningDepth): 12
- Max Inlining Code Length (maxInliningCodeLength): 68
- Min Inlining Code Length (minInliningCodeLength): 16
- Policy Triggered Decompilations (policyTriggeredDecompilations): true
- Max Working Memory Size (maxWorkingMemorySize): 1048576
- Max Compiled Method Size (maxCompiledMethodSize): 65535
- Code Cache Size (codeCacheSize): 523264
- Upper Code Cache Threshold (upperCodeCacheThreshold): 95%
- Lower Code Cache Threshold (lowerCodeCacheThreshold): 90%
- Pass Phi values in registers (XregisterPhis): true
- Pass locals in registers between blocks (XregisterLocals): true
- Compiling Causes Class Loading (XcompilingCausesClassLoading): false
- Trace (trace): none
-WARNING: Minimum heap size 25165824 is larger than start size 2097152, setting both to 25165824

GC[SS]: Initialized semi-space gen for generational GC
- Size of *each* semispace in bytes=1048576
- Limits of generation = [0x52000000,0x52200000)
- First semispace = [0x52000000,0x52100000)
- Second semispace = [0x52100000,0x52200000)
- Current semispace = First semispace

GC[MC]: Initialized mark-compact gen for generational GC
- Size of the space in bytes=24117248
- Limits of generation = [0x52200000,0x53900000)

GC[generational]: Sizes
- youngGen = min 1048576 start 1048576 max 1048576
- oldGen = min 24117248 start 24117248 max 66060288
- overall = min 25165824 start 25165824 max 67108864

GC[generational]: Auxiliary data structures
- heapBaseMemoryArea=[0x52000000,0x56100000)
- cardTable=[0x56100000,0x56120800)
- objectHeaderTable=[0x56121000,0x56141800)
- summaryTable=[0x56142000,0x561c4000)

-- maxMemory=65536 KB
-- totalMemory=24576 KB
0: totalMemory=24576 KB - freeMemory=22508 KB - maxMemory=65536 KB
25000: totalMemory=24576 KB - freeMemory=20556 KB - maxMemory=65536 KB
50000: totalMemory=24576 KB - freeMemory=18582 KB - maxMemory=65536 KB
75000: totalMemory=24576 KB - freeMemory=16600 KB - maxMemory=65536 KB
100000: totalMemory=24576 KB - freeMemory=14616 KB - maxMemory=65536 KB
125000: totalMemory=24576 KB - freeMemory=12745 KB - maxMemory=65536 KB
150000: totalMemory=24576 KB - freeMemory=10759 KB - maxMemory=65536 KB
175000: totalMemory=24576 KB - freeMemory=8772 KB - maxMemory=65536 KB
200000: totalMemory=24576 KB - freeMemory=6899 KB - maxMemory=65536 KB
225000: totalMemory=24576 KB - freeMemory=4913 KB - maxMemory=65536 KB
250000: totalMemory=24576 KB - freeMemory=2927 KB - maxMemory=65536 KB
275000: totalMemory=29380 KB - freeMemory=5744 KB - maxMemory=65536 KB
300000: totalMemory=29380 KB - freeMemory=3872 KB - maxMemory=65536 KB
Assertion failed at line 233 in c:\phoneme_advanced_mr2\cdc\src\share\javavm\runtime\cstates.c: cs->requester != ee
Java Frame java.lang.reflect.Method.invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;(Method.java:355)
Java Frame sun.misc.CVM.runMain()V(CVM.java:524)
Transition Frame sun.misc.CVM.runMain()V(Transition Method)
Free List Frame (JNI Local Frame)

I have no idea if the failing assertion (cs->requester != ee) is causing the memory exception, and
why it only fails when you try to allocate more than 32MB. Anybody else an idea?

Davy

yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,
Does anyone has information on how to exceed the limit of 32 MB ?

jackdaniels
Offline
Joined: 2009-09-16
Points: 0
yhilem
Offline
Joined: 2004-10-31
Points: 0

Hi,
Is this a bug?
We have a Java application that requires 128 MB RAM.
Our PDA has 256 MB RAM.
But we can not use the phoneMe Advanced JVM.