gcleak5.nim 371 B

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