Java.lang.StackOverflowError

estbn04 Messages postés 7 Date d'inscription vendredi 7 février 2003 Statut Membre Dernière intervention 12 février 2003 - 12 févr. 2003 à 15:07
cs_GermanBoy Messages postés 1 Date d'inscription dimanche 26 janvier 2003 Statut Membre Dernière intervention 24 novembre 2004 - 24 nov. 2004 à 15:14
hi!
here comes my pb:
i try to make a recursive call to a method that work on a file (to count the number of characters on each line, for a parser.
it's work well;but when the file is too big, i got a java.lang.StackOverflowError.
i tried some things like different options for JVM stack size(-Xms, -Xmx, -Xss) with no results.
i also try to use a bufferOutputStream to set buffer size..no more..
i become hopeless because it's important!!
so please help me!!

9 réponses

cs_Duss Messages postés 890 Date d'inscription lundi 8 avril 2002 Statut Membre Dernière intervention 29 juillet 2004 11
12 févr. 2003 à 16:54
well,
i think it's perhaps the cpu that cry !
have you test it on a better cpu (i hope you've not a 4GHtz cpu ;) )
Duss
0
estbn04 Messages postés 7 Date d'inscription vendredi 7 février 2003 Statut Membre Dernière intervention 12 février 2003
12 févr. 2003 à 17:17
well,well,
i think that a stackerror message is due to a lack of memory and isn't concerning a cpu problem!!
i think it's a problem with the JVM stack size...
so another solution??
0
estbn04 Messages postés 7 Date d'inscription vendredi 7 février 2003 Statut Membre Dernière intervention 12 février 2003
12 févr. 2003 à 17:17
well,well,
i think that a stackerror message is due to a lack of memory and isn't concerning a cpu problem!!
i think it's a problem with the JVM stack size...
so another solution??
0
JHelp Messages postés 261 Date d'inscription jeudi 5 septembre 2002 Statut Membre Dernière intervention 6 octobre 2005 11
12 févr. 2003 à 18:11
How do you scan the file ?
Do you stock all the file in memory before doing thinks ?
Your operation is only count the number of characters ?
Usaly the recursive method could be transform on a non-recurcive method. Java not support a lot of recursivity, but it's not a big problem, you transform your recurcive algorithm on a non-recursive algorithm, and the job is done.
JHelp

PS : sorry if my english is bad, it's usally a french forum
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_Duss Messages postés 890 Date d'inscription lundi 8 avril 2002 Statut Membre Dernière intervention 29 juillet 2004 11
12 févr. 2003 à 18:13
have you try to catch a

try
{ 

}
catch(StackOverflowError e)
{
System.out.println(e.printStackTrace());
}


somewhere ?

Duss
0
estbn04 Messages postés 7 Date d'inscription vendredi 7 février 2003 Statut Membre Dernière intervention 12 février 2003
12 févr. 2003 à 18:43
c pas grave pour l'anglais moi aussi je suis français mais je croyais que le forum était international..
sinon mon problème vient finalement du système (mauvaise config = mauvaise performance...)donc mémoire syst. et Cpu trop court mais la ça va mieux !!
merci JHelp et aussi Merci à Duss qui a su tout de suite!!
0
estbn04 Messages postés 7 Date d'inscription vendredi 7 février 2003 Statut Membre Dernière intervention 12 février 2003
12 févr. 2003 à 18:48
i tried a try/catch but with a bufferedoutputstream and i had the same result..
but don't worry...it's seems you were right on first solution!!i try my program on another machine and it worked perfectly, so i look deeply mine and i so that CPU and memory were bad config. for the Job..
i modified them and i hope it will work now!!!
thanks a lot for your inspiration!!!!
regards
0
cs_Duss Messages postés 890 Date d'inscription lundi 8 avril 2002 Statut Membre Dernière intervention 29 juillet 2004 11
13 févr. 2003 à 09:11
Ouah !
t'es français ! Fallait le dire plus tot !!
J'ai du scanner ma memoire a la recherche du peu de jargon
anglais qu'il me restait !!
Duss
0
cs_GermanBoy Messages postés 1 Date d'inscription dimanche 26 janvier 2003 Statut Membre Dernière intervention 24 novembre 2004
24 nov. 2004 à 15:14
sinon tu peux aussi compiler avec Jikes plutot que le jdk et tout ira mieux

;)
0
Rejoignez-nous