I create the Threads in the same Java with this instruction:

new Thread(...) { 

}



I think these are Java threads...or not?

yes I used VisualVM and it allocates no more then the heap allocated with 
the Xmx arguments to the Java executable. Infact Java does not fail for 
memory, it fails the OSv image when executed. 


Il giorno lunedì 20 maggio 2019 16:35:10 UTC+2, Waldek Kozaczuk ha scritto:
>
>
>
> On Sunday, May 19, 2019 at 12:19:59 PM UTC-4, robertob wrote:
>>
>> Hi everybody, 
>>
>> I have built an OSv image that run with QEMU and KVM acceleration. It 
>> executes a mine Java multi threading application.
>>
>> This is the command line I execute:
>>
>> capstan run unikure -n "bridge" -c 2 -m 4500M -e 
>> "--ip=eth0,192.168.122.101,255.255.255.0 
>> --defaultgw=192.168.122.1 --nameserver=192.168.122.1 /java.so -Xmx2024m 
>> -jar /Uni.jar"
>>
>> The image require these libs:
>>
>>     - openjdk8-zulu-compact3-with-java-beans
>>     - osv.httpserver-html5-gui-and-cli
>>     - osv.run-java
>>     - osv.cli
>>
>> My Java application allocates circa 400 threads and other services 
>> threads. The application has a strange behavior when it's executed in OSv: 
>> *despite 
>> the java app has set the Xmx to 1024 MB and It never reaches this maximum 
>> memory size, the execution in OSv halts and after some time I get a memory 
>> allocation error*. This seems so strange to me. Maybe Java threads 
>> occupy more memory when executed in OSv?
>>
> Are there 400 threads Java ones or all threads including OSv kernel ones? 
> Can you tell us roughly what this app does? Also when you run it on Linux 
> (same JRE, command line) does it use less memory?  
>
>>
>> I've tried different memory sizes for the execution of the image until 
>> 4500 MB. With that size the run terminates correctly, otherwise It halts. 
>>
>> Follows the log of my application with Heap memory of Java application 
>> and at the end the OSv image error. 
>>
>>
>>
>> 2019-05-19 09:17:42,508 DEBUG [g279TC#192.168.122.101:45830-ServerThread] 
>> ==> [HEAP] 1800M (max);118M (tot);90M (free); 
>>
>> Out of memory: could not reclaim any further. Current memory: 2036 Kb 
>> [backtrace] 
>> 0x00000000003ebe2c <memory::oom()+28> 
>> 0x00000000003ecd4c <memory::reclaimer::_do_reclaim()+380> 
>> 0x00000000003ecd9b <???+4115867> 
>> 0x0000000000400aa6 <thread_main_c+38> 
>> 0x00000000003a60a2 <???+3825826>
>>
>> Any suggestions?
>>
>
> Have you tried to connect with something like VisualVM and profile it this 
> way? 
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osv-dev/fe1105a0-74f2-4cb2-9fbe-efc6bc5e4142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to