1

我有一个与我的PApplet对象相关的相当严重的内存问题。我相信,我正在适当地对它们进行destroy()ing 和stop()ing,但是每次调用 时PApplet,对象内存都会继续增加。

任何帮助找出原因将不胜感激。

下面是我的程序层次结构:

// This button is component of MAIN JFRAME 
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { 
    TechnicPicForm tech=new TechnicPicForm ();
    tech.setVisible(true);
}

public class TechnicPicForm extends javax.swing.JFrame {        

     private createHexMirror crm;

     /**
     * Creates new form ResultForm
     */
    public TechnicPicForm() {
        crm = new createHexMirror(12,4.3,324,45,1);
        crm.init();
        this.setIconImage(new ImageIcon("images/logokanat.png").getImage());

        initComponents();
        jPanel1.add(crm);
}

    @SuppressWarnings("unchecked")
    Generated Code
    ------------Code for Init Components------------- 
    ---------------------------------------------------------------
    private void formWindowClosing(java.awt.event.WindowEvent evt) {                                   
        // TODO add your handling code here:
        crm.destroy();
    }                                  
}

import processing.pdf.*;
import processing.core.*;

public class createHexMirror extends PApplet {

   private float outC,littlePipeC,triangleLine,mirrorC ;
   private int mode;

    public createHexMirror(float outC, float littlePipeC , float triangleLine, float mirrorC , int mode) {
        this.outC= outC;
        this.littlePipeC = littlePipeC ;
        this.triangleLine= triangleLine;
        this.mirrorC = mirrorC;
        pmode = mode;
    }

    @Override
    public void setup() {
        noLoop();
        size(1000, 650);
        background(255);
    }

    public void draw() {

    ----------------SOME DRAW CODES------------------------
    }
}
4

0 回答 0