gcleak5.nim 364 B

1234567891011121314151617181920212223242526
  1. discard """
  2. output: "success"
  3. """
  4. import os, times
  5. proc main =
  6. var i = 0
  7. for ii in 0..50_000:
  8. #while true:
  9. var t = getTime()
  10. var g = t.getGMTime()
  11. #echo isOnStack(addr g)
  12. if i mod 100 == 0:
  13. let om = getOccupiedMem()
  14. #echo "memory: ", om
  15. if om > 100_000: quit "leak"
  16. inc(i)
  17. sleep(1)
  18. echo "success"
  19. main()