Skip to content

Instantly share code, notes, and snippets.

@rgarcia
Last active December 20, 2015 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rgarcia/6170213 to your computer and use it in GitHub Desktop.
Save rgarcia/6170213 to your computer and use it in GitHub Desktop.
node mem usage
# this will eat about 500MB of RAM
thecache = []
rnd_str = (length=30) ->
text = ""
possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
while text.length < length
text += possible.charAt(Math.floor(Math.random() * possible.length))
text
while thecache.length < 200000
thecache.push
School_id: rnd_str 4
Student_id: rnd_str 7
Student_number: rnd_str 7
State_id: rnd_str 3
Last_name: rnd_str 7
Middle_name: rnd_str 8
First_name: rnd_str 8
Gender: rnd_str 1
Dob: rnd_str 10
Grade: rnd_str 2
Student_email: rnd_str 0
Contact_name: rnd_str 23
Contact_type: rnd_str 27
Contact_phone: rnd_str 10
Contact_email: rnd_str 23
Username: rnd_str 7
Password: rnd_str 6
console.log thecache.length if not (thecache.length % 10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment