Java Bug - Field size & replaceItemValue => http-crash

Hello,

we are running domino 6.0.3 under Windows 2000. We noticed in our development environment a few http-crashes and “NotesException: Out of Memory” per diem.

I have analyzed the problem and found a issue in domino regarding java-agents. I think it is a domino bug, maybe one of the lotus guys can give an opinon about that ‘issue’.

Here ist the bug:

When you fill a field on a document using java with the method doc.replaceItemValue(String,String) and the size of the value-String is in the range 21801 between 21720 Bytes the domino server prints out NotesException: Out of memory

at lotus.domino.local.Document.NreplaceItemValue(Native Method)

at lotus.domino.local.Document.replaceItemValue(Unknown Source)

Frequently beside this exception the http-task crashes and the server must be restarted completly.

I have written a simple Web-Testagent. With this i could reproduce the behaviour on other domino 6.0.3 servers.

Here is the test-method (use in java-agent):

public static void test(Session session) throws Exception {

	System.out.println("Test - start");

	int len = 21720;	// length of the string that will be written

	byte[] array = new byte[len];

	for(int i = 0; i < (len-1); i++)

		array[i] = 0x41; // fill String with 'A'

		

	String str = new String (array);

	System.out.println("String length: "+str.length());

		

	Database db = session.getDatabase("","test.nsf");

	Document doc = db.createDocument();

	doc.replaceItemValue("Form","Test");

	doc.replaceItemValue("Value",str); // CRASH

	doc.save();

}

sincerely yours

Timo

Subject: Java Bug - Field size & replaceItemValue => http-crash

Well, 20KB is more than can be stored in a summary item (text field). That doesn’t explain the HTTP crash (which is probably a bug if reproducible), but it does explain the NotesException.

Subject: RE: Java Bug - Field size & replaceItemValue => http-crash

The interesting thing is, if you call replaceItemValue with a String that has a length of 25.000, 250.000 or 2.500.000 Bytes no NotesException:Out of memory orccures. If the String is to long another java exception/error occures: java.lang.OutOfMemoryError.Domino and java is very strange :slight_smile:

Timo