r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[Core] Discuss core issues

Louis
16-Oct-2006
[5737]
Yes, I understand this. I think I've done this right. View, however, 
I don't understand.
BrianH
16-Oct-2006
[5738]
You and me both.
Jerry
19-Oct-2006
[5739]
How do I use the CALL native function to call a external program 
via shell and wait for the program to finish. I try the /wait refinement, 
but it does not work.
* Example: 
call/wait "regedt32 /E C:\backup.reg"
PeterWood
19-Oct-2006
[5740x4]
It appears to be something specific to the application being called. 
Both call/wait "cmd" and call/wait "C:\Program Files\rebol\view\rebol.exe" 
worked as expected for me though call/wait "regedt32" didn't.
Regedt32 is returning a 0 completion code to Rebol as it is being 
loaded which Rebol returns from the call:
>> call/wait "C:\Windows\System32\regedt32.exe"
== 0
This suggests that regedt32 is simply a loader for another program.
From http://en.wikipedia.org/wiki/Windows_Registryit seems that 
regedt32.exe invokes regedit.exe.


The page also hints that it may be better to use reg.exe to update 
the registry from a script
Jerry
19-Oct-2006
[5744x2]
Thank you, Peter.
I've just got an Out-Of-Memory error.

Is there any way to have more virtual memory for REBOL to use. In 
Java, I can use command-line options to ask the OS to allocate more 
memory for my app. In REBOL, I have no idea.
Maxim
19-Oct-2006
[5746]
on windows?
Gregg
19-Oct-2006
[5747]
REBOL should just use all it needs. What are you trying to do?
Maxim
19-Oct-2006
[5748x3]
on windows, the OS should give you all the VM until the OS runs out. 
 I've had REBOL use more than 1 GB of RAM... without doing anything 
special.
(obviously, perfomance drops dramatically... but that's the OS's 
fault)
the machine only had 512MB of physical RAM btw.
Graham
19-Oct-2006
[5751]
I've seen this happen before ... brings windows to a stop :(
Maxim
19-Oct-2006
[5752x2]
you just need to have more VM setup than all apps need... at least 
it wont crash windows.
but like you say... it crawls... on its back.
Allen
19-Oct-2006
[5754x2]
Jerry, was it a "real" memory error, or where you just trying to 
decompress damaged data?
>> d: compress "jsagkjdsjhgkjdshgkjdhf"
== #{789CCB2A4E4CCFCE4A29CECA00536032230D00688B090D16000000}
>> decompress random  d
** Script Error: Not enough memory
** Near: decompress random d
Jerry
19-Oct-2006
[5756]
About the out-of-memory error, the story is ...


I am trying to compare two complete Windows Registry, which are both 
huge. I export them into files (in little-endian 16-bit Unicode), 
which are both 300+ MB. To save the space and to make REBOL easy 
to handle them, I encode these files into UTF-8. they are now 150+ 
MB. I try to load these two UTF-8 files into memory:

>> lines1: read/lines %/c/reg1.reg

== ["Windows Registry Editor Version 5.00" "" "[HKEY_LOCAL_MACHINE]" 
"" ...
>> lines3: read/lines %/c/reg2.reg
== ** Script Error: Not enough memory
** Where: halt-view
** Near: halt 
>> rebol/version
== 1.3.2.3.1
Maxim
19-Oct-2006
[5757x4]
have you tried not using lines?  its pretty easy to chop them up 
after...
not saying /lines has an issue, but I have loaded 700MB ascii files 
on a 1GB RAM computer... 150 is peanuts.  but I never use the /lines 
argument.
you should use the stats to see if something strange is going on. 
 It will give you the amount of RAM REBOL is currently using.
>> stats
== 4432555
Allen
19-Oct-2006
[5761]
There have been some issues with read/lines .  What REBOL version 
are you using? http://www.rebol.net/cgi-bin/rambo.r?sort=1&limit=1&cmd=Search&id=&pattern=read%2Flines
Maxim
19-Oct-2006
[5762]
just above he quoted:

 >> rebol/version
== 1.3.2.3.1
Allen
19-Oct-2006
[5763]
[Allen mumbles something about his glasses]
Maxim
19-Oct-2006
[5764]
lol  :-)
Jerry
19-Oct-2006
[5765x2]
Without the /line refinement, it takes less memory, and the situation 
is much better. When it reach the 1.28 GB Memory (observed by STATS), 
however, The Out-Of-Memoey Error still happened. Does the 1.28GB-boundary 
have anything to do with my 1GB physical memory?
Is there a way that I can make REBOL recycle the memory? RECYCLE 
seems not to work. Thanks for your help.
Maxim
19-Oct-2006
[5767x2]
strange... are you processing the files in any way? appending.  I 
don't see how loading two 150MB files jumps stats over 1.2GB
there is a possibility that windows does not allow any application 
to allocate more than 1.2GB.  I remember that a 3d application (Maya) 
seemed to crash or freeze when it reached  that amount or RAM IIRC.
Maxim
20-Oct-2006
[5769]
recycle will only work if you free all references to data.  you can 
do this by setting any unused global and local vars to none.
Jerry
20-Oct-2006
[5770]
Thank you Maxim. I loaded more than two 150MB files into the system 
actually. I did set unused global variables to none, then called 
RECYCLE, but it still not worked. Thanks, anyway.
Maxim
20-Oct-2006
[5771x3]
do you pass the data to functions?
cause functions retain the pointers even if they use local values.
a little shortcomming of the actual function implementation. (which 
I hope will be addressed in R3 )
Anton
20-Oct-2006
[5774x2]
Jerry, if you're not aware, just a word of caution about line by 
line entry in the console; the console will attempt to mold the result. 
That means rebol will use at least the same amount of memory again 
just to create the molded string.
I would avoid molding by putting length? on the front, and I'd also 
avoid line conversions done in non-binary mode:

	length? lines3: read/binary %/c/reg2.reg
Maxim
20-Oct-2006
[5776x2]
is it normal that join attemps to evaluate its second argument?
ex:
>> join [1 2 3] [bogus-word]
** Script Error: bogus-word has no value
** Where: repend
** Near: bogus-word

where append does not give the error:

>> append copy [1 2 3] [bogus-word]
==  [1 2 3 bogus-word]
the help only talks about concatenation, no details about reducing 
the second argument    , :-/
Graham
20-Oct-2006
[5778]
try repend .. that will give you the error you seek!
Maxim
20-Oct-2006
[5779]
exactly, I would have expected the error with rejoin. not join.
Graham
20-Oct-2006
[5780]
except join normally converts the second argument to the datatype 
of the first
Maxim
20-Oct-2006
[5781x2]
rejoin converts all internal values to the value of its first item 
in the block... similar...
but if both arguments are blocks... it should not complain.
Graham
20-Oct-2006
[5783]
rambo it
Maxim
20-Oct-2006
[5784x3]
even if I do a to-block on [bogus-word] I get no errors.
I will   :-)
sourcing join I see it uses repend instead of append.  any gurus 
share to comment if they think this shold be changed?