World: r3wp
[Core] Discuss core issues
older newer | first last |
PeterWood 30-Aug-2006 [5235x5] | I was able to duplicate the access error with read %/ with a clean Rebol instance by opening more than 256 files. |
The default max number of files per process for OS/X is 256 - see http://developer.apple.com/qa/qa2001/qa1005.html | |
I used "fstat -p 9999" to list all the files currently open by Rebol - 9999 being the first PID of the Rebol instance | |
From a couple of experiments, Rebol was properly free the File IDs when the files were closed. | |
was -> did | |
Gabriele 31-Aug-2006 [5240x2] | so maybe Uniserve just keeps files open for performance (or a bug)? |
then changing it so that it doesn't keep more than 200 open should fix Will's problems. | |
Will 31-Aug-2006 [5242] | Thanks to all for bringing some light, it seams actually the problem IS related to file handle limit. Checked with (suggested by Jaime): sudo fs_usage -w -f filesys <process id>|grep 'open\|close' and the number of open and close correspond. Peter suggested "fstat -p <process id>", fortunately fstat isn't there in 10.4 Tiger, so I was looking for a similar tool and found lsof for which I did not find the flag to filter for only uniserve process and there I saw something else was actually consuming file handles.. Sorry Carl to have thought about a rebol error ;-)) Uniserve is rock solid and blazing fast btw. |
Graham 31-Aug-2006 [5243] | I take it that OSX is not a server OS. |
MikeL 31-Aug-2006 [5244] | Will, can you say more about what you used uniserve for and how it helped you. ... in the uniserve group? I've been waiting for Doc to give the presentation "Uniserve for the slow class". |
Will 31-Aug-2006 [5245] | Mike, look in uniserve group |
Oldes 3-Sep-2006 [5246] | Anybody knows, why there is such a difference between result of 'stats and the memory usage shown in tools like 'top or 'taks-manager? For example I found, that if I run a script under rebol/base in linux and do stats I get something like 1.7MB but in the 'top I see memory usage more than 5MB. The same it is under windows - pure rebol/base has les ten 1MB but almost 4MB in the task-manager. Strange is, that rebol/base shows me more memory usage in 'top, then rebol/core, but rebol/core more if I use 'stats. |
Ingo 4-Sep-2006 [5247] | Hi Oldes, I'm not sure, but I guess, that they are measuring different things, e.g. if I use process explorer (from sysinternalts.com) I can show 3 different sizes: private bytes, virtual size and working set, which differ like this ... 15.724, 50,832, 8.824 (this is view on windows). |
Oldes 4-Sep-2006 [5248] | I'm just suprised, that Rebol/Core shows me more memory using stats but less in top than Rebol/Base where I have less memory in stats but more in top |
Volker 4-Sep-2006 [5249] | Its typical for gc-languages. The os-memory-handling is not optimized for this case. So they reserve some extra memory for faster allocation. |
Oldes 4-Sep-2006 [5250x2] | And the difference between stats and values in top is because in top there are counted linked libraries as well:-) |
And if I use pmap command I can see that there is one bigger memory block which will be probably the preallocated space - then if I create in Rebol for example some string, the memory usage in pmap is not changed although stats increase. | |
Cyphre 4-Sep-2006 [5252] | Oldes: I think not all memory allocations of the interpreter are under control of the 'Rebol GC' so the STATS value should be always smaller than the real OS mem usage. |
BrianW 6-Sep-2006 [5253x2] | I've been using the following approach for using a series like a stack, and I was wondering if there was a better way I'd missed: insert my-list item ;; "pop" item: my-list/first ;; "push" part 1 remove/part my-list 1 ;; "push" part 2 I know it's working on the beginning of the series rather than the end, but I had trouble remembering if there is a '"pop" (remove last item from series and return item to caller) sort of function for Rebol. |
Sorry, switch the 'pop' and 'push' comments in my sample. I'm still waking up | |
Anton 6-Sep-2006 [5255x2] | remove removes one value, no need to specify /part .. 1 |
anyway, don't you mean this: item: first my-list ; pop part 1 remove my-list ; pop part 2 | |
BrianW 6-Sep-2006 [5257] | yes. I shouldn't have bothered posting until I finished my coffee. |
Anton 6-Sep-2006 [5258] | :) |
BrianW 6-Sep-2006 [5259] | I'd been using 'x: my-list/1' |
Anton 6-Sep-2006 [5260] | Using a path like that is not safe if you want to pop a function. It will call the function. To avoid that use either FIRST or PICK my-list 1 |
BrianW 6-Sep-2006 [5261] | Thanks |
Anton 6-Sep-2006 [5262x2] | >> stack: [] == [] >> insert stack func [arg][] == [] >> stack/1 ** Script Error: 1 is missing its arg argument ** Near: stack/1 >> first stack >> pick stack 1 >> |
So you get that weird looking error message when using path notation. | |
Oldes 9-Sep-2006 [5264] | How to remove once used word from system/words list? For example if I do>> load [my-word1 my-word2] << The words, are now in the system/words (find first system/words 'my-word1) Is it possible to remove them at this moment somehow (I know that it will be changed in R3)? |
Volker 9-Sep-2006 [5265] | No. |
Gabriele 9-Sep-2006 [5266] | volker is right, there's no way to remove words from system/words. |
Graham 9-Sep-2006 [5267] | if you have a situation where f1: does [ f2 f3 f4 ] .. where all f1 - f4 are functions, is there a way that f2 can cause a return to the calling function of f1. Do I have to throw an error to do this? |
Ladislav 10-Sep-2006 [5268x2] | Graham: I guess you mean something like: f1: func [[throw]] [f2]. |
(my TFUNC does this "more comfortably" and for REBOL3 a change in that direction is planned) | |
Graham 10-Sep-2006 [5270] | Ok. |
Ladislav 11-Sep-2006 [5271x4] | How RETURN works in R2 |
let's define the following function: g: func [f [any-function!]] [f [return 1] 2] | |
now we may test what happens for different argument functions we may supply: | |
>> g :do ; == 1 == 1 >> g func [blk] [do blk] == 2 >> g func [[throw] blk] [do blk] == 1 | |
Ladislav 13-Sep-2006 [5275] | poll: do you find it acceptable that for some numbers load mold number is an error? |
Anton 13-Sep-2006 [5276] | example ? |
Ladislav 13-Sep-2006 [5277x3] | the maximal or minimal possible decimal! values cannot be load molded |
(while they can be computed, if you know how) | |
(do you really want me to present a formula here?) | |
Rebolek 13-Sep-2006 [5280] | IMO it should be moldable |
Ladislav 13-Sep-2006 [5281] | they are moldable, but you cannot load the result back |
Anton 13-Sep-2006 [5282] | Are they valid values or not ? |
Ladislav 13-Sep-2006 [5283] | they are valid |
Anton 13-Sep-2006 [5284] | Then they should be loadable, shouldn't they ? There will inevitably be a case where they are needed in a program. |
older newer | first last |