cs_chahde14
Messages postés16Date d'inscriptionmardi 9 décembre 2008StatutMembreDernière intervention20 août 2011
-
17 août 2011 à 00:47
cs_chahde14
Messages postés16Date d'inscriptionmardi 9 décembre 2008StatutMembreDernière intervention20 août 2011
-
20 août 2011 à 00:23
slt
quand je lance l'execution de mon petit programme il m'affiche cette erreur
si vous pouvez m'aider comment corriger cette erreur
merci.
cs_chahde14
Messages postés16Date d'inscriptionmardi 9 décembre 2008StatutMembreDernière intervention20 août 2011 17 août 2011 à 00:48
dsl voila l'erreur:
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
at desktopapplication2.DesktopApplication2View.(DesktopApplication2View.java:38)
at desktopapplication2.DesktopApplication2.startup(DesktopApplication2.java:19)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
cs_Julien39
Messages postés6414Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention29 juillet 2020371 17 août 2011 à 07:59
Bonjour,
java.lang.OutOfMemoryError : t n'a pas assez de mémoire pour terminer le processus. Si c'est un petit programme c'est que tu as fait une erreur. Montre nous ton code qu'on puisse t'en dire plus.
/**
* The application's main frame.
*/
public class DesktopApplication2View extends FrameView {
String[] mots;
double[][] mat;
int nbmots;
public DesktopApplication2View(SingleFrameApplication app) {
super(app);
initComponents();
this.jFileChooser1.setVisible(false);
mat=new double[1000][10000];
mots=new String[10000];
nbmots=0;
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
statusMessageLabel.setText("");
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
statusAnimationLabel.setIcon(busyIcons[0]);
busyIconIndex = 0;
busyIconTimer.start();
}
progressBar.setVisible(true);
progressBar.setIndeterminate(true);
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
statusAnimationLabel.setIcon(idleIcon);
progressBar.setVisible(false);
progressBar.setValue(0);
} else if ("message".equals(propertyName)) {
String text = (String)(evt.getNewValue());
statusMessageLabel.setText((text == null) ? "" : text);
messageTimer.restart();
} else if ("progress".equals(propertyName)) {
int value = (Integer)(evt.getNewValue());
progressBar.setVisible(true);
progressBar.setIndeterminate(false);
progressBar.setValue(value);
}
}
});
}
@Action
public void showAboutBox() {
if (aboutBox == null) {
JFrame mainFrame = DesktopApplication2.getApplication().getMainFrame();
aboutBox = new DesktopApplication2AboutBox(mainFrame);
aboutBox.setLocationRelativeTo(mainFrame);
}
DesktopApplication2.getApplication().show(aboutBox);
}
/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
mainPanel = new javax.swing.JPanel();
jFileChooser1 = new javax.swing.JFileChooser();
jButton1 = new javax.swing.JButton();
menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu();
jMenu1 = new javax.swing.JMenu();
jCheckBoxMenuItem2 = new javax.swing.JCheckBoxMenuItem();
jCheckBoxMenuItem3 = new javax.swing.JCheckBoxMenuItem();
jCheckBoxMenuItem4 = new javax.swing.JCheckBoxMenuItem();
javax.swing.JMenuItem exitMenuItem = new javax.swing.JMenuItem();
javax.swing.JMenu helpMenu = new javax.swing.JMenu();
javax.swing.JMenuItem aboutMenuItem = new javax.swing.JMenuItem();
statusPanel = new javax.swing.JPanel();
javax.swing.JSeparator statusPanelSeparator = new javax.swing.JSeparator();
statusMessageLabel = new javax.swing.JLabel();
statusAnimationLabel = new javax.swing.JLabel();
progressBar = new javax.swing.JProgressBar();
jDialog1 = new javax.swing.JDialog();
private final Timer messageTimer;
private final Timer busyIconTimer;
private final Icon idleIcon;
private final Icon[] busyIcons = new Icon[15];
private int busyIconIndex = 0;
cs_Julien39
Messages postés6414Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention29 juillet 2020371 17 août 2011 à 14:54
Bonjour,
Ton code est un peu trop long pour que je puisse trouver une boucle infinie là dedans, essayes de voir si tu n'as pas un problème avec une boucle while.
Je ne sais pas si tu utilises la récursivité mais c'est souvent une cause de ce genre d'exception.
Sinon, c'est peut être une limite technique et tu n'as pas assez de ressources pour faire tourner ton programme.
Une autre remarque \r\t\n peut être remplacé par \p{Space}
Vous n’avez pas trouvé la réponse que vous recherchez ?
cs_Julien39
Messages postés6414Date d'inscriptionmardi 8 mars 2005StatutModérateurDernière intervention29 juillet 2020371 17 août 2011 à 14:56
CE genre de choses par exemple new double[1000][10000]; ça fait quand même 10000000 valeurs à enregistrer. Je pense que ca doit vite poser problème donc, ce n'est pas étonnant que tu ais ce problème.
cs_chahde14
Messages postés16Date d'inscriptionmardi 9 décembre 2008StatutMembreDernière intervention20 août 2011 18 août 2011 à 13:21
slt
j'ai essyé de corriger l'erreur mais cette fois me donne une autre erreur :
"
Error occurred during initialization of VM
Too small initial heap for new size specified"
concernant le code j'ai besoin d'aide pour corriger cette partie si possible:
int M 8, N 5;
Matrix B = Matrix.random(5, 3);
Matrix A = Matrix.constructWithCopy(mat);
//Matrix A = Matrix.random(M, N).times(B).times(B.transpose());
System.out.print("A = ");
A.print(9, 6);
// compute the singular vallue decomposition
System.out.println("A = U S V^T");
System.out.println();
SingularValueDecomposition s = A.svd();
System.out.print("U = ");
Matrix U = s.getU();
U.print(9, 6);
System.out.print("Sigma = ");
Matrix S = s.getS();
S.print(9, 6);
System.out.print("V = ");
Matrix V = s.getV();
V.print(9, 6);
System.out.println("rank = " + s.rank());
System.out.println("condition number = " + s.cond());
System.out.println("2-norm = " + s.norm2());
// print out singular values
System.out.print("singular values = ");
Matrix svalues = new Matrix(s.getSingularValues(), 1);
svalues.print(9, 6);