Package java.io

Examples of java.io.ObjectOutputStream.reset()


          oos.flush();
          if (++counter >= CoreConstants.OOS_RESET_FREQUENCY) {
            // failing to reset the stream periodically will result in a
            // serious memory leak (as noted in AbstractSocketAppender)
            counter = 0;
            oos.reset();
          }
        }
        catch (InterruptedException ex) {
          Thread.currentThread().interrupt();
        }
View Full Code Here


        oos.writeObject(event);
        oos.flush();
      // Failing to reset the object output stream every now and
      // then creates a serious memory leak.
      // right now we always reset. TODO - set up frequency counter per oos?
      oos.reset();
      }
      catch(IOException e) {
        // there was an io exception so just drop the connection
        oosList.removeElementAt(streamCount);
        LogLog.debug("dropped connection");
View Full Code Here

                this.getClass().getName() + ".serialize");
        try {
            FileOutputStream fos = new FileOutputStream(serialize);
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(this.seed);
            oos.reset();
            oos.writeObject(this.seed);
            oos.reset();
            oos.writeObject(this.seed);
            oos.close();
            // Read in the object.
View Full Code Here

            FileOutputStream fos = new FileOutputStream(serialize);
            ObjectOutputStream oos = new ObjectOutputStream(fos);
            oos.writeObject(this.seed);
            oos.reset();
            oos.writeObject(this.seed);
            oos.reset();
            oos.writeObject(this.seed);
            oos.close();
            // Read in the object.
            FileInputStream fis = new FileInputStream(serialize);
            ObjectInputStream ois = new ObjectInputStream(fis);
View Full Code Here

        oos.writeObject(event);
        oos.flush();
      // Failing to reset the object output stream every now and
      // then creates a serious memory leak.
      // right now we always reset. TODO - set up frequency counter per oos?
      oos.reset();
      }
      catch(IOException e) {
        // there was an io exception so just drop the connection
        oosList.removeElementAt(streamCount);
        LogLog.debug("dropped connection");
View Full Code Here

        ObjectOutputStream oout = this.oout;
        if (resetInterval != 0) {
            // Resetting will prevent OOM on the receiving side.
            writtenObjects ++;
            if (writtenObjects % resetInterval == 0) {
                oout.reset();

                // Also discard the byproduct to avoid OOM on the sending side.
                buffer.discardReadBytes();
            }
        }
View Full Code Here

        oos.writeObject(serEvent);
        oos.flush();
        if (++counter >= CoreConstants.OOS_RESET_FREQUENCY) {
          // Failing to reset the object output stream every now and
          // then creates a serious memory leak.
          oos.reset();
          counter = 0;
        }
      }
    } catch (IOException ex) {
      addInfo(peerId + "connection failed: " + ex);
View Full Code Here

        ObjectOutputStream oout = this.oout;
        if (resetInterval != 0) {
            // Resetting will prevent OOM on the receiving side.
            writtenObjects ++;
            if (writtenObjects % resetInterval == 0) {
                oout.reset();

                // Also discard the byproduct to avoid OOM on the sending side.
                buffer.discardReadBytes();
            }
        }
View Full Code Here

        oos.writeObject(event);
        oos.flush();
      // Failing to reset the object output stream every now and
      // then creates a serious memory leak.
      // right now we always reset. TODO - set up frequency counter per oos?
      oos.reset();
      }
      catch(IOException e) {
        if (e instanceof InterruptedIOException) {
            Thread.currentThread().interrupt();
        }
View Full Code Here

    public void marshal(Object command, DataOutput ds) throws IOException {
        ObjectOutputStream out = new ObjectOutputStream((OutputStream)ds);
        out.writeObject(command);
        out.flush();
        out.reset();
    }

    public Object unmarshal(DataInput ds) throws IOException {
        try {
            ClassLoadingAwareObjectInputStream in = new ClassLoadingAwareObjectInputStream((InputStream)ds);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.