From: Volker Borchert on
Guilbert STABILO wrote:
> I have to run 12 instances of this same feeder process (each started with
> a different command line).
> At initialisation time, one instance need 2 GB to initialize then release
> the 2 GB.
> The instance then have to be up for 24h listening to some network event.
> Then the second instance start, eat 2 GB, release the memory and so on
> ....
>
> At the end, I have 12 instances running concurrently on the same
> computer.
> This worked fine under Windows but not under Solaris.
>
> In facts, I only succeeded in starting 5 of the 12 instances.
> On the 6th one, I get a memory allocation error.
> I found that under Solaris (from the "malloc (3C)" manual page), when a
> process release some memory, the memory is made available for the process
> but not for the system.
> Therefore, I have no memory left for the other instances so they can not
> start.
> I insist on the fact that I have absolutely no memory leaks.
>
> Here is my system (uname -a):
>
> SunOS mssenna01 5.10 Generic_127112-10 i86pc i386 i86pc
>
> ... and the available memory (top):
>
> Memory: 4096M phys mem, 3054M free mem, 8001M total swap, 7558M free swap

So the working set of your feeders will be small after the startup
phase? For a quick solution, I would try adding a 24GB swap file,
and hope that the "dead" pages rotting there will not hurt.

--

"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy(a)ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert <v_borchert(a)despammed.com>
From: Guilbert STABILO on
v_borchert(a)despammed.com (Volker Borchert) �crivait
news:hbqgdu$4rv$1(a)Gaia.teknon.de:

> So the working set of your feeders will be small after the startup
> phase? For a quick solution, I would try adding a 24GB swap file,
> and hope that the "dead" pages rotting there will not hurt.

In facts, I already found a solution : linking my code with "-lmapmalloc"
solved my problem.

From: Guilbert STABILO on
Paul Floyd <root(a)127.0.0.1> �crivait
news:slrnhe1bia.vk.root(a)tryfan.orange.fr:

> This code is wrong. As you can see from your log, when new fails, a
> std::bad_alloc exception is thrown. new does not return a 0 pointer.

You're absolutely right : I get confused because it seemed to me that an
older version of malloc was returning null when the allocation failed.

> On Solaris, you need as much VM as you allocate. So if you want to
> allocate 20G, then you need 20G of VM. It looks like your machine has
> 4G of RAM. That means that you're going to need at least 16G of swap.

I discovered that it was possible to change the memory allocation model by
explicitely linking with "-lmapmalloc" and it works. I can see the memory
decreasing after the initialisation phase.