@@ -0,0 +1,2345 @@
+import java.util.List;%0A%0Aimport rx.Observable;%0Aimport rx.functions.Func1;%0Aimport rx.schedulers.Schedulers;%0A%0Apublic class BackpressureGcMain %7B%0A%0A    public static void main(String... args) throws InterruptedException %7B%0A        Observable.range(0, 20)%0A                // batch the filenames so we don't overload merge%0A                .buffer(Runtime.getRuntime().availableProcessors() - 2)%0A                .map(new Func1%3CList%3CInteger%3E, Observable%3CInteger%3E%3E() %7B%0A                    @Override%0A                    public Observable%3CInteger%3E call(List%3CInteger%3E list) %7B%0A                        return Observable.from(list);%0A                    %7D%0A                %7D).concatMap(new Func1%3CObservable%3CInteger%3E, Observable%3CPointer%3E%3E() %7B%0A                    @Override%0A                    public Observable%3CPointer%3E call(Observable%3CInteger%3E n) %7B%0A                        return Observable%0A                        // integers for ever%0A                                .range(0, Integer.MAX_VALUE)%0A                                // use up some heap%0A                                .map(new Func1%3CInteger, Pointer%3E() %7B%0A                                    @Override%0A                                    public Pointer call(Integer m) %7B%0A                                        // use up some gc for every item%0A                                        Pointer pointer = new Pointer(null);%0A                                        for (int i = 0; i %3C 1000; i++)%0A                                            pointer = new Pointer(pointer);%0A                                        %0A                                        return pointer;%0A                                    %7D%0A                                %7D)%0A                                // async%0A                                .subscribeOn(Schedulers.computation());%0A                    %7D%0A                %7D).map(new Func1%3CPointer, Boolean%3E() %7B%0A%0A                    @Override%0A                    public Boolean call(Pointer pointer) %7B%0A                        if (pointer == null)%0A                            return true;%0A                        else%0A                            return false;%0A                    %7D%0A                %7D).subscribe();%0A        Thread.sleep(100000000L);%0A    %7D%0A%0A    private static class Pointer %7B%0A        private Object o;%0A%0A        Pointer(Object o) %7B%0A            this.o = o;%0A        %7D%0A    %7D%0A%0A%7D%0A

add backpressure gc main