Bill,

try this as a starting point (it's only a rough outline, you'll have
to fill in the missing bits). As you'll see, it's neither elegant nor
minimal, and will probably spit out *lots* of stuff. Use your
favourite source repo and some judgement to get to the core of this.

/* use dtrace w. -C and include errno.h, also use -F (or pragma flowindent) */

fork1:entry
{
   self->s =speculation();
   speculate(self->s);
}

fork1:return
/self->s && arg1 == 0 && errno == ENOMEM/  /* fork1 fails! */
{
   commit(self->s);
   self->s = 0;
}

fork1:return
/self->s/
{
   discard(self->s);
   self->s = 0;
}

fbt:::entry,
fbt:::return
/self->s/
{
   speculate(self->s);
}

this last probe creates all the output - perhaps you can somehow
reduce it to only produce output if enomem is returned ... or
something.

HTH
Michael
On Fri, Feb 4, 2011 at 22:06, Bill Shannon <bill.shan...@oracle.com> wrote:
> Bart Smaalders wrote on 02/ 4/11 11:49 AM:
>>
>> On 02/04/11 11:33, Bill Shannon wrote:
>>>
>>> This isn't really specific to OpenSolaris since it also happens on
>>> Solaris 10, but maybe someone here can give me some ideas?
>>>
>>> I have a java program that is failing because it does something that
>>> calls
>>> fork1(), which fails with ENOMEM (confirmed using truss):
>>>
>>> 27010/2: fork1() Err#12 ENOMEM
>>>
>>> I've used both the 32-bit and 64-bit versions of the JVM. Using the
>>> 64-bit
>>> version, I see the heap expand to just over 4GB before it forks:
>>>
>>> 27010/30: brk(0x107DE3D90) = 0
>>>
>>> I have almost 160 GB of swap space:
>>>
>>> $ swap -s
>>> total: 806336k bytes allocated + 167872k reserved = 974208k used,
>>> 159746184k available
>>>
>>> It doesn't seem like it can possibly be running out of swap space.
>>>
>>> What other reasons would cause fork1() to fail with ENOMEM?
>>> _______________________________________________
>>
>> The vm system is rather fond of using ENOMEM as a generic error bucket.
>> If you have a way of reproducing the problem, a bit of DTrace will quickly
>> turn
>> up the reason. I assume it's only the 32 bit version
>> that is failing to fork, right?
>
> Sorry, I wasn't clear.  The 64-bit version fails as well.  With the 32-bit
> version I limit the Java heap to 2GB.  It doesn't run out of heap, but the
> fork fails.
>
> I'm sure dtrace will solve every problem I have, but I don't know how
> to use it to solve this problem!  :-(  Hints?
> _______________________________________________
> opensolaris-discuss mailing list
> opensolaris-discuss@opensolaris.org
>



-- 
regards/mit freundlichen Grüssen
Michael Schuster
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to