LvJimmy, thanks for your warnning. Since I just plan to develop some reseach on 
DRLVM platform. I will not run my benchmark on other JVM.

----- Original Message ----- 
From: "LvJimmy,Jing" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Sunday, April 29, 2007 5:04 PM
Subject: Re: problem about System.loadLibrary and object's address


> 2007/4/29, 吴廷鹏 <[EMAIL PROTECTED]>:
>> Hi, all,
>> when I use drlvm to execute my program, I found that when program has 
>> System.loadLibrary call, there is always an error which reports 
>> "java.lang.outofmemoryerror <no stack trace available>". The same program 
>> can run on Hotspot. Why this happens and how to solve it?
>>
>> Another question, I read the implementation code of Object.clone method in 
>> Object_generic.cpp.
>>
>> jobject object_clone(JNIEnv *jenv, jobject jobj)
>> {
>>     ObjectHandle h = (ObjectHandle) jobj;
>>
>>     //aquire the target address and assign it to variable named result
>>
>>     memcpy(result, h->object, size);
>>
>> }
>> According to my comprehension, h->object is the address of java object. Is 
>> it ture? Does this means I can use the same way to get the address of object 
>> in vmcore's other place provided the necessary head file is included?
>>
> 
> I suggest you ALWAYS use API structure and methods when writing native
> codes(JNI, JVMTI, etc). The code you list here is too tricky and
> depends on real implementation of JVM, I believe other JVM supports
> Harmony may not use such structure, so your program may fail with
> them, this is not you want, right?
> I'm not sure what you want to do, why you need to access the address
> of the object?
> 
>> Thanks,
>> tingpeng
>>
> 
> 
> -- 
> 
> Best Regards!
> 
> Jimmy, Jing Lv
> China Software Development Lab, IBM
>

Reply via email to