Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

question on memory usage  RSS feed

 
Reshma Das
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
someone pls email me the memory usage for request.getParamter("hello"). which is better situation in terms of memory usage ?
case 1:
System.out.println(request.getParamter("hello")
);
case 2:
String hello = request.getParamter("hello");
System.out.println(hello);
Thanks,
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both cases cause creation of a String, the only difference is that in case 2 the String won't be GC-able as long as the variable is in scope.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!