Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

test ulimit

60 views
Skip to first unread message

SANKY

unread,
Sep 6, 2010, 12:33:32 AM9/6/10
to
Hi,

Is it possible to write a tcl program to test ulimit functionalities,
i am familiar about open files, open processes limits but for stack
size/data size and all say for e.g if 2 MB stacksize is max and 50 mb
data size is max, in that case what could be the logic i could use in
program?..

thanks in advance,...

Alexandre Ferrieux

unread,
Sep 6, 2010, 2:59:30 AM9/6/10
to

For data size, a bit [string repeat] (for example) should do the job.
But for stack size, it's good you ask now (with 8.6 as yet
unreleased), because vanilla proc recursion will soon stop consuming
stack the way it used to ;-) This wild magic is called the Non
Recursive Engine aka Stackless Tcl.

-Alex

SANKY

unread,
Sep 6, 2010, 6:17:54 AM9/6/10
to
Cool, That will do it.. Thanks a lot for info :)

Any suggestion for "max locked memory (kbytes, -l)" field how about it?

Donal K. Fellows

unread,
Sep 6, 2010, 6:27:28 AM9/6/10
to

With data size, you can just use [string repeat]. Note that it'll be
working with two bytes per character.

With stack size, in 8.5 you can just do recursive calls while using
[interp recursionlimit] to increase the built-in depth. In 8.6, this
is no longer effective because we've moved to using a (C-)stackless
execution engine - well, there's a C stack still but it doesn't get
very deep - for almost everything, which enables all sorts of
interesting things like tailcalls and coroutines. It also means that
we can run normal scripts in very limited environments, a requirement
that goes way back. Anyway, this makes doing what you want rather
difficult; the best way to defeat it is to use the [time] command to
build up real recursion:

proc reallyRecurse {} {
time { reallyRecurse }
}

We are not about to convert the [time] command to be non-recursive
(it's awkward and not really that important; yielding from inside is
not in the spirit of things either) so that's probably the most
practical suggestion I've got. Oh, and you'll still need [interp
recursionlimit] of course.

Donal.

Donal K. Fellows

unread,
Sep 6, 2010, 6:31:27 AM9/6/10
to
On 6 Sep, 11:17, SANKY <sankarram...@gmail.com> wrote:
> Any suggestion for "max locked memory (kbytes, -l)" field how about it?

We don't lock memory in the sense that means (i.e., with mlock(2)) at
all; you'll need to write C code to exercise that.

Donal.

Donal K. Fellows

unread,
Sep 6, 2010, 6:31:03 AM9/6/10
to
On 6 Sep, 11:17, SANKY <sankarram...@gmail.com> wrote:
> Any suggestion for "max locked memory (kbytes, -l)" field how about it?

We don't lock memory in the sense that means (i.e., with mlock(2)) at

SANKY

unread,
Sep 7, 2010, 2:05:23 AM9/7/10
to
Thanks folks, thats very helpful...
0 new messages