Try it online!
Explanation
(s - space, t - tab, n - newline)
nssn ; Declares a label consisting of the empty sequence
nstn ; Call the procedure given by the empty label (declared above)
This is a slight abuse of the rules. The call procedure command jumps to the specified label and marks the current location for a later return. The mechanisms for doing this are implementation dependent but a basic implementation used by many interpreters is to push the current location to a call stack and pop values when a ret command is encountered. This will therefore end up filling up the call stack of the interpreter.
Whitespace, 12 bytes - Fills the stack
Try it online!
Explanation
nssn ; Declare label ''
sssn ; Push 0
nsnn ; Jump to label ''
Continuously pushes the value 0 to the stack, causing the stack to grow until the interpreter crashes.
Whitespace, 29 bytes - Fills the heap
Try it online!
Explanation
ssstn ; push 1
nssn ; label ''
sns ; duplicate n
tsss ; add (effectively multiplies by 2)
sns ; duplicate n (to use as a heap address)
sns ; duplicate n (to use as a value)
tts ; store n at the address n
nsnn ; jump ''
Fills heap addresses given by 2^n with the value of 2^n, starting at n=1. Consumes memory faster on interpreters that implement the heap as an array but will also work for interpreters that use a non-contiguous data structure backing the heap (such as a dictionary/map).
(reduce conj [] (range))
(Clojure) gets up to 737mb, then just stops growing. Idk how it's not continually going up. It "thinks" I want to print the entire list at the end, so it shouldn't be throwing anything away. Very frustrating. \$\endgroup\$