bitrich-info / xchange-stream

XChange-stream is a Java library providing a simple and consistent streaming API for interacting with Bitcoin and other crypto currency exchanges via WebSocket protocol. It is build on top of of XChange library providing new interfaces for streaming API. User can subscribe for live updates via reactive streams of RxJava library.
Apache License 2.0
413 stars 222 forks source link

xchange-stream library has memory leak issue on exchange disconnect #495

Closed pchertalev closed 4 years ago

pchertalev commented 4 years ago

How to reproduce:

        ExchangeSpecification exchangeSpecification = new ExchangeSpecification(KrakenStreamingExchange.class);

        for (;;) {
            StreamingExchange krakenExchange = StreamingExchangeFactory.INSTANCE.createExchange(exchangeSpecification);
            krakenExchange.connect().blockingAwait();
            krakenExchange.disconnect().subscribe(() -> LOG.info("Disconnected"));
        }

bitrich-leak

mdvx commented 4 years ago

ExchangeSpecification is empty so only public socket is created

pchertalev commented 4 years ago

Issue is reproduced for public socket and private socket - it is core bitrich functionality

mdvx commented 4 years ago

good catch and fix

pchertalev commented 4 years ago

Thanks. Close issue