harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Petrenko (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-3148) [Classlib][nio] alloc many DirectByteBuffers may cause memory-out-error
Date Wed, 23 May 2007 16:22:16 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-3148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12498285
] 

Alexey Petrenko commented on HARMONY-3148:
------------------------------------------

Guys,

unfortunately this patch does not work on Windows.

Here is the memory check code
=== cut ===
#define MEMORYLOADTHRESHOLD 95 // 95%
#define MEMORYFREETHRESHOLD 0x4000000 //64M

hysysinfo_is_system_physical_memory_low (struct HyPortLibrary *portLibrary, UDATA load_threshold,
UDATA free_threshold) 
{
    MEMORYSTATUSEX stat;
    stat.dwLength = sizeof (stat);

    if(GlobalMemoryStatusEx(&stat))
     {
        if(stat.dwMemoryLoad >= load_threshold || stat.ullAvailPhys <= load_threshold){
            return TRUE;
    }
=== cut ===

GlobalMemoryStatusEx reports global memory status but not the status for the current process.
So we are waiting while full system memory load will be higher then 95% or available physical
memory will be less the 95 bytes. I guess that this is usual situation on 512M or even 1G
system. But this is not true for my 4G server :) So this fuction always return false for me.
And OOM happens after 100 iterations.

I undestand that free_threshold and load_threshold parameters are mixed up here. But I believe
that putting them in place will not help.

So the issue needs additional investigation.

> [Classlib][nio] alloc many DirectByteBuffers may cause memory-out-error
> -----------------------------------------------------------------------
>
>                 Key: HARMONY-3148
>                 URL: https://issues.apache.org/jira/browse/HARMONY-3148
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Jimmy, Jing Lv
>         Assigned To: Alexey Petrenko
>         Attachments: H-3148_2.patch, patch-3148.zip
>
>
> Hi,
>      As discussed on mailing-list, DirectByteBuffer uses native memory which is out of
GC-control, alloc many DirectByteBuffer may cause memory-out-error if they are not GCed, even
they can be GCed at that time. 
>      This happens in Harmony but not in RI. This should be a bug of Harmony.
>      Note: other native memory users, e.g., java.util.zip.Deflater, may cause this problem
as well.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message