Faq » History » Version 3

Celso Reyes, 06/18/2013 10:52 AM

1 1 Celso Reyes
h1. Frequently Asked Questions
2 1 Celso Reyes
3 1 Celso Reyes
4 1 Celso Reyes
5 1 Celso Reyes
h2. Installation
6 1 Celso Reyes
7 1 Celso Reyes
h3. Do I really need to have the IRIS-WS library installed?
8 1 Celso Reyes
9 1 Celso Reyes
Although irisFetch will run "out of the box" by accessing an online version of the java library, it is _highly_ recommended that you download the latest library, and add it to the MATLAB java class path.
10 1 Celso Reyes
11 1 Celso Reyes
h3. Which versions of MATLAB are supported?
12 1 Celso Reyes
13 1 Celso Reyes
irisFetch was developed using MATLAB r2011b.  irisFetch is expected to run on R2009b and greater. However, IrisFetch has been able to successfully run on R2009a on the Solaris System.
14 1 Celso Reyes
15 1 Celso Reyes
h3. Is there an Octave version of irisFetch.m?
16 1 Celso Reyes
17 1 Celso Reyes
No. An attempt to port irisFetch into the octave environment was unsuccessful.  Octave was unable to properly interact with the IRIS-WS java library. This may be re-examined in the future.
18 1 Celso Reyes
19 1 Celso Reyes
h2. Troubleshooting
20 1 Celso Reyes
21 1 Celso Reyes
h3.  Error message "java.lang.OutOfMemoryError: Java heap space" when retrieving traces / events / stations
22 1 Celso Reyes
23 1 Celso Reyes
The "heap space" is where java stores -objects- variables and data that it creates.  When irisFetch retrieves information from a data center, it interacts using a Java library. All the information that is retrieved from web services is first stored in the "heap" memory that has been specifically set aside for Java. Once all the data has been retrieved, it is then converted into MATLAB structs. At this point, the memory in the heap becomes available again.
24 1 Celso Reyes
25 1 Celso Reyes
MATLAB may have a limited heap to begin with. For example, R2011a running on Mac OSX allows the heap to be set between 0 and 256Mb.  Even when the heap is set at 256 Mb, it doesn't take too much time series data before Java run out of memory.  Ideally, you could go to the MATLAB preferences, and under "General" -> "Java Heap Memory", increase the heap size.  If you see this error message, and MATLAB does not allow the heap to be enlarged further, then you may be able to increase it by following the advice of this article:
26 1 Celso Reyes
27 1 Celso Reyes
28 1 Celso Reyes
29 1 Celso Reyes
>The article, in short, suggests modifyng the java.opts file located in a system-specific directory. For my Mac with R2011b, java.opts was located at @/Applications/
30 1 Celso Reyes
> I only had to add the line specifying that the MATLAB should set the max heap memory to 2 gigs:
31 1 Celso Reyes
> @-Xmx2048m@
32 1 Celso Reyes
33 1 Celso Reyes
Setting the heap to a larger value (for example, 2048 Mb) allows MATLAB and irisFetch to retrieve more data before running out of memory.
34 2 Celso Reyes
35 2 Celso Reyes
h3. I get an Invalid file or directory message when trying to add the IRIS-WS.jar with @javaaddpath@
36 2 Celso Reyes
37 2 Celso Reyes
<pre><code class="matlab">
38 3 Celso Reyes
>> javaaddpath('IRIS-WS-2.0.jar')
39 2 Celso Reyes
Warning: Invalid file or directory
40 2 Celso Reyes
. . .
41 2 Celso Reyes
42 2 Celso Reyes
43 2 Celso Reyes
It is likely that MATLAB is looking in the wrong place for the .jar.  
44 2 Celso Reyes
45 2 Celso Reyes
These few lines of code should ensure that MATLAB is reading *exactly* the file from wherever it exists. It provides a file-selection box where you can navigate to the .jar, and then uses that info to call javaaddpath.
46 2 Celso Reyes
47 2 Celso Reyes
<pre><code class="matlab">
48 2 Celso Reyes
[f , d] = uigetfile({'.jar'}); 
49 2 Celso Reyes
thefile = fullfile(d,f); %build the complete path accurately  (works independent of linux/unix/mac/windows)
50 2 Celso Reyes
51 2 Celso Reyes
52 2 Celso Reyes
53 2 Celso Reyes
If this works, then, in the future, call javaaddpath using the entire path, as contained in variable thefile.