4
I am using JPA in a project, with the Hibernate implementation, still using Java 7.
And constantly Permgen runs out of space. I know it’s because of Hibernate, how new I am in this java technology. Someone knows indicate some less heavy implementation for JPA. I went to use Eclipselink was worse because I didn’t even deploy it.
I didn’t want to increase Permgen, I wanted a solution and not a palliative.
Already in Java 8 I’m not with this problem because there is no more space, was replaced by Metaspace, even so the application grows too.
Any hint?
But this Permgen crash happened right after the deploy, with 10 records in the bank, I know my Permgen was small anyway. However, I wanted a solution so that the data would not increase in this way. As for the actualization of these API I liked the Querydsl, the iBatis I used, but wanted a ORM(automatic).
– user6406
@uaiHerbert, Java8 no longer has Permgen, is now Metaspace, and the default size is the limit available on your computer, I know that one day the memory will burst.
– user6406
If you have available all the machine memory, in the case of Java8, I do not understand what the problem is of increasing Permgen. If with 10 objects memory already flies I don’t think any other framework would solve your problem. If you use pure JDBC, maybe not with 10, but memory will burst in the same way.
– uaiHebert
If you search for objects like Detached the memory usage will decrease, but still, it will not solve your problem having a server with such limited memory.
– uaiHebert
No, the memory overflow is not related to the application data, for example: millions of records I search from the database, these millions of objects will be removed by GC, the problem is that some API carry a lot of class from your lib, and these classes not registered in Permgem(extinct No 8). But, is not pq was extinguished in version 8, which I must be reassured, as it has many applications I need from previous versions(in case I need).
– user6406
This end of Permgen I see as a 'makeup'. Even in Java8 you can also limit the size of the memory used, which by default is not enabled. I see that good practice the correct is to limit the memory size and not leave open for infinite use.
– uaiHebert
I doubt very much that your application carries millions of records without JPA and with only 10 records already happens the memory overflow. I believe that there is some misuse there.
– uaiHebert
Of course, that’s why I was looking for an alternative to Hibernate/JPA, because I don’t want to keep increasing my Permgen just so I can use Hibernate. I know this mémoria: 1º is not associated with the application data. 2º GC does not have access to collect any data that has been logged, nor even clear the loaded classes (it makes no sense to clear the loaded classes). 3º Hibernate and Eclipselink loads many classes.
– user6406
Any ORM mapping will load classes into memory. Unless they bravely want to implement their own reflection, which is something I’ve heard about.
– uaiHebert