× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 1/22/2014 1:06 PM, D*B wrote:
Respectfully, I have the same problem with a Java-only implementation of
POI/HSSF on my PC. When I work with very large spreadsheets, I run out
of memory. One might argue that I haven't set my JVM up properly, and
one would be correct. But this is not something I worried about in RPG
since I left the overlay linkage editor behind on System/3.

POI/HSSF is not well suited for larger spreadsheets, it takes the complete sheet to memory - and if it's big enough, you will run into memory problems; but this is mainly a problem of the Excel format (Horrible SpreadSheet Format). Writing this in RPG would take years and you would run into memory problems quite more easy. Java is one of the easiest languages to deal with dynamic memory allocation, to allocate memory, you would simply use the new operator and if nobody needs the variable any more, the memory is freed by the garbage collector. To enforce this, simply set the variable to null and if no refernece is pointing to the storage anymore, it's deallocated automatically. dynamic memory allocation using RPG is by far more difficult, you would have to allocate and deallocate the memory by your own, with could be dangerous, if you've passed the pointer to another module. BTW: without using RCLRSC or RCLACTGRP, you will fill up memory with no more used variables...

It is very true that POI/HSSF is not well suited for large spreadsheets.
It is true that the entire spreadsheet needs to be in memory - this is
why I pointed out that freeing up Java objects might not solve the OPs
problem.
Dynamic memory is not usually an issue for RPG programmers - we don't
generally use it at all. This is different from Java where almost
everything uses dynamic memory. This is why I wrote that RPG
programmers don't often worry about running out of memory.

Working at several employers, on several different models of the
hardware, with OS releases starting with V3R6, I have yet to receive an
'out of memory' error from an RPG program. I managed to get an 'out of
memory' error on my 2nd or 3rd Java program - Java, not JNI invoked by
RPG. It is true that I don't have a sophisticated ILE environment -
just a single named activation group covers all my needs - but that is
my personal experience.

I program PIC microcontrollers in my spare time in their native assembly
language as well as in C. I mention this so that you have a context to
put my notes into. I'm very familiar with programs dealing with memory
dynamically because I do it with the bare silicon. Please don't think
of this thread as 'stupid RPG guy does not understand real programming'.

If anyone is still reading, Dieter is correct about HSSF having issues
with large spreadsheets. This may or may not be the OP's issue - it
sure was my issue. And in my case, it wasn't about the implementation
of JNI with RPG because I wrote the thing in plain old Java on my PC to
test it out and I got the exact same out of memory exception.
--buck

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.