MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Flat Mode Flat  

Vas Crabb
BOFH
Reged: 12/13/05
Posts: 4462
Loc: Melbourne, Australia
Send PM
Re: Memory leak when compiling the emumem files.
12/28/20 04:01 AM


> Something within Mame's code is causing cc1plus.exe to memory leak when it compiles
> at the emumem files (at least on my end). It shouldn't have to use >10 GB of ram just
> to compile Mame.Didn't mean to say 10GB b/c that was from compiling under -j5.

It’s not a memory leak, it just uses a lot of memory to compile emumem_aspace.cpp, emumem_mview.cpp and luaengine.cpp – a leak is when it loses track of allocations and never releases memory.

> So the "j" setting from my examination determines how much instances of cc1plus are
> used when compiling Mame. I decided to check memory behavior for only one cc1plus
> instance and the memory used for this application just kept rising until it was
> finished with an emumem file. Highest I seen it go up to so far was about 5 GB of ram
> used compiling emumem_mview.cpp.
>
> What I did was use Resource Monitor to inspect cc1plus.exe's memory usage. Wait until
> cc1plus compiles the emumem files and watch the ram usage rise.

Well yeah, compiling large, complex functions with lots of templates uses a lot of memory.

> Edit: Seems to be a known issue:
> https://github.com/mamedev/mame/commit/5...891bc1008ed94..
> Going to have to compile with two cc1plus instances "-j2" until this bug is fixed for
> good.

That has nothing to do with RAM usage when compiling, that issue would cause MAME to crash with a stack overflow on start. It’s completely unrelated, and it is fixed.







Entire thread
Subject Posted by Posted on
* Trouble compiling Mame after the C++17 change Hydreigon 12/25/20 09:19 PM
. * Re: Trouble compiling Mame after the C++17 change Hydreigon  12/27/20 09:39 PM
. * Re: Trouble compiling Mame after the C++17 change Vas Crabb  12/28/20 03:55 AM
. * Re: Trouble compiling Mame after the C++17 change Haze  12/27/20 09:46 PM
. * Memory leak when compiling the emumem files. Hydreigon  12/28/20 01:33 AM
. * Re: Memory leak when compiling the emumem files. Haze  12/28/20 04:34 AM
. * Re: Memory leak when compiling the emumem files. Hydreigon  12/28/20 06:09 AM
. * Re: Memory leak when compiling the emumem files. Vas Crabb  12/28/20 07:20 AM
. * Re: Memory leak when compiling the emumem files. Hydreigon  12/31/20 03:18 AM
. * Re: Memory leak when compiling the emumem files. Vas Crabb  12/31/20 05:18 AM
. * Re: Memory leak when compiling the emumem files. Haze  12/31/20 03:34 AM
. * Re: Memory leak when compiling the emumem files. Vas Crabb  12/28/20 04:01 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 33 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1330