[Mono-bugs] [Bug 634529] New: Mono runtime always allocates ~3MB of data for shared file info structs
bugzilla_noreply at novell.com
bugzilla_noreply at novell.com
Wed Aug 25 16:34:37 EDT 2010
https://bugzilla.novell.com/show_bug.cgi?id=634529
https://bugzilla.novell.com/show_bug.cgi?id=634529#c0
Summary: Mono runtime always allocates ~3MB of data for shared
file info structs
Classification: Mono
Product: Mono: Runtime
Version: SVN
Platform: All
OS/Version: All
Status: NEW
Severity: Major
Priority: P5 - None
Component: io-layer
AssignedTo: lupus at novell.com
ReportedBy: mantas at unity3d.com
QAContact: mono-bugs at lists.ximian.com
Found By: ---
Blocker: ---
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US)
AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.126 Safari/533.4
The source, where the problem occurs:
http://github.com/mono/mono/blob/master/mono/io-layer/wapi-private.h
175: #define _WAPI_FILESHARE_SIZE 102400
<...>
195: struct _WapiFileShare share_info[_WAPI_FILESHARE_SIZE];
This array (~3.0 MB) gets allocated almost every time on Android and iPhone
platforms when any of handles are accessed and this code is unnecessary heap
hungry on mobile platforms.
Defining DISABLE_SHARED_HANDLES doesn't solve the case, because even in this
case memory gets allocated in :
gpointer
_wapi_shm_attach (_wapi_shm_t type)
{
guint32 size;
switch(type) {
case WAPI_SHM_DATA:
return g_malloc0 (sizeof(struct _WapiHandleSharedLayout));
case WAPI_SHM_FILESHARE:
return g_malloc0 (sizeof(struct _WapiFileShareLayout));
default:
g_error ("Invalid type in _wapi_shm_attach ()");
return NULL;
}
}
Reproducible: Always
Steps to Reproduce:
1. Run mono application check native heap size
2. Reduce _WAPI_FILESHARE_SIZE to 1024 (instead of 102400)
3. Recompile mono & run app, native heap size is reduced by ~2.9 MB
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the mono-bugs
mailing list