Jim Jacob

Greenhorn
+ Follow
since May 27, 2008
Merit badge: grant badges
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Jim Jacob

1. java -version gives you the details of your JVM

2. On a unix enviornment, use ps -ef | grep java to find all the running Java processes.
16 years ago
Found the answer to my question.
Heap fragmentation is the cause for this.

Here is an article on Developerworks, worth reading.

http://www.ibm.com/developerworks/ibm/library/i-gctroub/
16 years ago
Hi Ranchers,

I am experiencing frequent OutOfmemory issues in WebSphere Application Server, and I'm treying to tune the JVM Heap Size.

Given below a few lines from my native_stederr.log

<AF[9132]: Allocation Failure. need 391344 bytes, 7135 ms since last AF>
<AF[9132]: managing allocation failure, action=2 70525752/618068480)>
<GC(9132): GC cycle started Wed Jul 30 10:30:41 2008
<GC(9132): freed 374573296 bytes, 72% free (445099048/618068480), in 276 ms>
<GC(9132): mark: 244 ms, sweep: 32 ms, compact: 0 ms>
<GC(9132): refs: soft 0 (age >= 32), weak 3779, final 256, phantom 0>
<AF[9132]: completed in 288 ms>

My question is:

If 70525752/618068480 bytes is the free heap size at the time of GC, why does the JVM reports an allocation failure of 391344 bytes?

Regards,
Jim Jacob
16 years ago
It can still be done, using getName() method of the java.io.File. If you do this, the you will have to re-write the code that saves the file, to use this modified file name.

Instead of doing all these, why dont you remove the code which is adding the ".log" extension to the file being saved?
16 years ago
Yes, this is how it is.
Calling Remove on a new entity will ignore it. Same is the case if you call remove on an entity which is already removed.
But, Calling persist on a removed entity throws EntityNotFoundException when using Hibernate as the Persistence provider. But accoring to the specification, it should become managed.



BidsEntityBean bid = new BidsEntityBean();
bid.setBidderId(20l);
bid.setItemId(30l);
bid.setBidAmount(250.00);
bid.setBidDate(null);

//Removing a New Entity == No Exceptions
entityManager.remove(bid);

//Persisting the new entity == No Exceptions
entityManager.persist(bid);

BidsEntityBean oldBid = entityManager.find(BidsEntityBean.class, new Long(23));

//Removing the entity returned by Find
entityManager.remove(oldBid);

//Removing a Removed Entity == No Exceptions
entityManager.remove(oldBid);

//Persisting a Removed Entity == Exception
//javax.persistence.EntityNotFoundException: deleted entity passed to persist:
oldBid.setItemId(40l);
entityManager.persist(oldBid);
[ June 17, 2008: Message edited by: Jim Jacob ]
Why dont you do something like this:
Get the selected file name with extension using getSelectedFile() from th e FileChooser, then extract the file name without the etension from it, before attempting to save.
Something like this:
filename.substring(0,filename.lastIndexOf('.'))
16 years ago