Bonjour.

J'ai un problème de mémoire avec Eclipse.

Mon programme s'appuie sur un fichier texte qui fait 18 Mo. Pour pouvoir travailler dessus j'ai ajouté chaque ligne dans une ArrayList.

Problème : à mon avis la mémoire n'est pas suffisante (celle allouée à l'ArrayList d'après ce que j'ai compris) car quand je lance mon programme j'ai ce message d'erreurs qui s'affiche :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at java.util.ArrayList.ensureCapacity(Unknown Source)
	at java.util.ArrayList.add(Unknown Source)
	at infosmiRNA.actionPerformed(infosmiRNA.java:457)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)
Et ma ligne de code 457 qui est précisée dans le message d'erreur est celle-ci :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
while (ligne!=null)
{
listlignesmirbase.add(ligne.toString());   // ligne n°457
}
Comment résoudre ce problème de mémoire ?
Sur le net j'ai trouvé qu'il fallait rajouter "-XX:PermSize=128m-XX:MaxPermSize=256m" dans le fichier eclipse.ini mais cela n'a rien fait de plus ...

Quelqu'un aurait-il une idée ?
Merci beaucoup !!!