kicking the ruby garbage collector’s trash [how to improve memory usage for MRI]

Here’s some pointers I’ve found helpful:

fork off child processes to do a lot of memory usage then die–that way you for sure reclaim that memory
use GC in another child process [email me for details]
Use temp files — Marshal.dump large quantities of data to them while you’re not using it, then Marshal.load it when it is desired.
slim_attributes helps with mysql related usage.

Here’s some more intense options:
rewrite erb to re-use strings
write a “slim array” that encompasses simple ints and strings and floats more memory efficiently than Ruby’s currently does.

drivers for qwest 2wire gray 802.11g grey

So…you found an old gray qwest usb and want to install drivers for windows on it [when you plug it in it says “cannot install this hardware”

Turns out you can get drivers for this “legacy” hardware go to http://support.2wire.com/index.php?page=download then choose adapters -> legacy hardware -> 802.11g gray

If you’ve already told windows to “never try to install drivers again” then you may want to go to the device manager and delete the device, unplug it, reboot, and then plug it in again.

Questions leave a comment.

-=R

ruby tempfile is slow

so…you make some tempfiles and it starts taking like 10s to create after you make lots of them?
Turns out that if you use the same name, on creation, if you reuse the same name, it always starts at 0 and searches for the first non-used number starting with that name. So…O(N^2). How to fix: use different names each time.
Cheers.
-=R

rubydoctest woe

/home/rdp/i386/gemrepository/gems/rubydoctest-1.0.0/bin/../lib/code_block.rb:55:in `actual_result’: undefined method `actual_result’ for nil:NilClass (NoMethodError)

for me meant “you named a test rubydoctest instead of doctest!” and also meant “you have some weird comment syntaxes that look ALMOST like a doctest.

To fix: at code_block.rb:55 put in an ‘return ‘unknown’ unless @statements.last_whatever it is