Skip to content

Instantly share code, notes, and snippets.

@takikawa
Last active August 29, 2015 13:56
Show Gist options
  • Save takikawa/9281459 to your computer and use it in GitHub Desktop.
Save takikawa/9281459 to your computer and use it in GitHub Desktop.
#lang racket/load
(define (memory)
(for ((i (in-range 10)))
(collect-garbage))
(define n (current-memory-use))
(for ((i (in-range 10)))
(collect-garbage))
n)
(define m1 (memory))
(for ([i (in-range 100)])
(define i-sym (string->symbol (number->string i)))
#`'#,i-sym)
(define m2 (memory))
(displayln m1)
(displayln m2)
23243320
24479128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment