Gabor,
thanks for the suggestion.

I did as you have suggested- Started a clean session of R and set the java
option.  Then I sourced the library and tried to read the xlsx file but got
the same error.  I am assuming that Java machine is loaded when the package
xlsx is sourced and not when the base package is sourced (or in other words
upon starting a new R session).  Or am I totally off?

Regards
Nikhil

On Wed, Feb 9, 2011 at 8:28 PM, Gabor Grothendieck
<ggrothendieck@gmail.com>wrote:

> On Wed, Feb 9, 2011 at 6:12 PM, Nikhil Joshi <nikhiljoshi@gmail.com>
> wrote:
> > I am trying to read an xlsx spreadsheet (1506 rows, 501columns) all
> > populated but getting the following error:
> > Please advise as to how to get around this issue.
> >
> >> res <- read.xlsx("c:\\BSE_v2.xlsx",1)
> > Error in .jcall("RJavaTools", "Ljava/lang/Object;", "invokeMethod", cl,
>  :
> >  java.lang.OutOfMemoryError: Java heap space
> >
> > Here is the session info:
> >
> >> sessionInfo()
> > R version 2.12.1 (2010-12-16)
> > Platform: i386-pc-mingw32/i386 (32-bit)
> >
> > locale:
> > [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United
> > States.1252
> > [3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
> >
> > [5] LC_TIME=English_United States.1252
> >
> > attached base packages:
> > [1] grid      stats     graphics  grDevices utils     datasets  methods
> > base
> >
> > other attached packages:
> >  [1] xlsx_0.2.4                   xlsxjars_0.2.0
> rJava_0.8-8
> >
> >  [4] quantmod_0.3-15              TTR_0.20-2
> > Defaults_1.1-1
> >  [7] urca_1.2-4                   RBGL_1.26.0
>  graph_1.28.0
> >
> > [10] colorspace_1.0-1             spatstat_1.21-4
>  deldir_0.0-13
> >
> > [13] mgcv_1.7-2                   reshape_0.8.4                plyr_1.4
> >
> > [16] fExtremes_2100.77            fTrading_2100.76
> > fGarch_2110.80
> > [19] fBasics_2110.79              timeSeries_2130.90
> > timeDate_2130.91
> > [22] mc2d_0.1-9                   mvtnorm_0.9-96
> > mixtools_0.4.4
> > [25] boot_1.2-43                  MASS_7.3-9
> > SuppDists_1.1-8
> > [28] ghyp_1.5.4                   gplots_2.8.0
> caTools_1.11
> >
> > [31] bitops_1.0-4.1               gdata_2.8.1
>  gtools_2.6.2
> >
> > [34] numDeriv_2010.11-1           xtable_1.5-6
> > PerformanceAnalytics_1.0.3.2
> > [37] sn_0.4-16                    mnormt_1.4-0                 xts_0.7-5
> >
> > [40] zoo_1.6-4                    RODBC_1.3-2
> >
> > loaded via a namespace (and not attached):
> > [1] lattice_0.19-13    Matrix_0.999375-46 nlme_3.1-97        tools_2.12.1
> >
>
> Try this to increase the heap size (or use some other size):
>
>   options(java.parameters = "-Xmx1000m")
>
> It should be done any time before the java machine is loaded.
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>

	[[alternative HTML version deleted]]

