Gangmax Blog

JDeveloper & ulimit

我在安装JDeveloper的时候,看到安装指南上有这么一段:

6.2 Setting the System Resource Limit

The minimum recommended system resource limit for Oracle JDeveloper on Linux systems is 4096. To determine the resource limit configuration for your system, enter:

1
/bin/sh -c 'ulimit -n'

If the value returned is less than 4096, you set the system resource limit:

  1. Open the limits.conf file, which is located in the /etc/security/ directory.

  2. Look for the following lines:

    • soft nofile

    • hard nofile

  3. In the lines, change the value to 4096. The lines will then read:

    • soft nofile 4096

    • hard nofile 4096

我以前从来没有接触过ulimit这个东东,google了一下,这里有介绍:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ulimit

User limits - limit the use of system-wide resources.

Syntax
ulimit [-acdfHlmnpsStuv] [limit]

Options

-S Change and report the soft limit associated with a resource.
-H Change and report the hard limit associated with a resource.

-a All current limits are reported.
-c The maximum size of core files created.
-d The maximum size of a process's' data segment.
-f The maximum size of files created by the shell(default option)
-l The maximum size that may be locked into memory.
-m The maximum resident set size.
-n The maximum number of open file descriptors.
-p The pipe buffer size.
-s The maximum stack size.
-t The maximum amount of cpu time in seconds.
-u The maximum number of processes available to a single user.
-v The maximum amount of virtual memory available to the process.

也就是说“/bin/sh -c ‘ulimit -n’”这行命令是确定“打开文件描述符的最大数目上限”。为什么JDeveloper需要同时打开这么多文件描述符、而Eclipse和Netbeans就不需要呢?

Added@20110913:

今天我尝试用JDeveloper打开一个Oracle BPEL的例子时,发现因为ulimit设置没有修改导致的问题,看来不设置还真不行。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
Sep 13, 2011 3:23:56 PM oracle.security.jps.util.JpsUtil disableAudit
INFO: JpsUtil: isAuditDisabled set to true
Sep 13, 2011 3:23:58 PM oracle.security.jps.util.JpsUtil disableAudit
INFO: JpsUtil: isAuditDisabled set to true
Sep 13, 2011 3:28:51 PM oracle.javatools.db.AbstractDatabase testIsConnectionAlive
INFO: Alive check for ADF was skipped (one already in progress).
Sep 13, 2011 3:28:51 PM oracle.javatools.db.AbstractDatabase testIsConnectionAlive
INFO: Alive check for ADF was skipped (one already in progress).
[3:33:41 PM] Migration started.
Sep 13, 2011 3:33:45 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Migrating Faces Config
Sep 13, 2011 3:33:47 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Removing Tag Libraries from Project: JSF Core 1.2, JSF HTML 1.2
Sep 13, 2011 3:33:47 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Removing Libraries from Project
Sep 13, 2011 3:33:47 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Adding Tag Libraries to Project: JSF Core 2.0, JSF HTML 2.0
Sep 13, 2011 3:33:48 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Migrating ADF Faces to JSF2.0
Sep 13, 2011 3:33:48 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Cleaning '.jsps' directory
Sep 13, 2011 3:33:48 PM oracle.jdevimpl.webapp.faces.migration.MigratorMessageLog updateProgress
INFO: Cleaning '.tags' directory
Sep 13, 2011 3:33:48 PM oracle.ideimpl.history.HistoryManagerImpl2 persistInitialState
WARNING: An error occurred while saving history data.
java.io.FileNotFoundException: /home/user/Desktop/workflow-104-ContractApproval/workflow-104-ContractApproval/ContractApprovalApp/ContractApprovalTaskFlow/public_html/WEB-INF/web.xml (Too many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at oracle.ide.net.FileURLFileSystemHelper.openInputStream(FileURLFileSystemHelper.java:756)
at oracle.ide.net.URLFileSystemHelperDecorator.openInputStream(URLFileSystemHelperDecorator.java:296)
at oracle.ideimpl.net.LazyURLFileSystemHelperDecorator.openInputStream(LazyURLFileSystemHelperDecorator.java:370)
at oracle.ide.net.URLFileSystemHelperDecorator.openInputStream(URLFileSystemHelperDecorator.java:296)
at oracle.ide.net.URLFileSystem.openInputStream(URLFileSystem.java:1319)
at oracle.ide.net.URLFileSystem.copy(URLFileSystem.java:356)
at oracle.ide.history.Historian.copy(Historian.java:68)
at oracle.ideimpl.history.HistoryManagerImpl2.persistInitialState(HistoryManagerImpl2.java:363)
at oracle.ide.model.TextNode.saveImpl(TextNode.java:605)
at oracle.bali.xml.addin.XMLSourceNode.saveImpl(XMLSourceNode.java:943)
at oracle.ide.model.Node.save(Node.java:1182)
at oracle.jdevimpl.webapp.WebAppProjectNodeMigrator$1MigrateNConvertRunnable.run(WebAppProjectNodeMigrator.java:407)
at oracle.jdevimpl.webapp.WebAppProjectNodeMigrator$1MigrateNConvertRunnable.start(WebAppProjectNodeMigrator.java:142)
at oracle.jdevimpl.webapp.WebAppProjectNodeMigrator.migrate(WebAppProjectNodeMigrator.java:423)
at oracle.jdevimpl.webapp.WebAppProjectNodeMigratorHelper.migrate(WebAppProjectNodeMigratorHelper.java:231)
at oracle.ide.migration.NodeMigrator.callHelperMigrate(NodeMigrator.java:629)
at oracle.ide.migration.NodeMigrator.callHelpersMigrate(NodeMigrator.java:615)
at oracle.ide.model.ProjectMigrator.super_callHelpersMigrate(ProjectMigrator.java:48)
at oracle.ide.model.ProjectMigrator.access$000(ProjectMigrator.java:30)
at oracle.ide.model.ProjectMigrator$1.run(ProjectMigrator.java:67)
at oracle.javatools.data.Structure.applyBatchChanges(Structure.java:231)
at oracle.ide.model.HashStructureNode$1.run(HashStructureNode.java:327)
at oracle.javatools.data.Structure.applyBatchChanges(Structure.java:231)
at oracle.ide.model.HashStructureNode.applyBatchChanges(HashStructureNode.java:323)
at oracle.ide.model.ProjectMigrator.callHelpersMigrate(ProjectMigrator.java:63)
at oracle.ide.migration.NodeMigrator.doMigration(NodeMigrator.java:569)
at oracle.ide.migration.NodeMigrator$1.run(NodeMigrator.java:522)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:655)
at java.lang.Thread.run(Thread.java:662)
Sep 13, 2011 3:33:48 PM org.apidesign.netbinox.JarBundleFile$1 checkedOpen
WARNING: Cannot open file /home/user/java/Oracle/Middleware/jdeveloper/ide/lib/oracle.ide.osgi.jar
Sep 13, 2011 3:33:48 PM org.apidesign.netbinox.JarBundleFile$1 checkedOpen
WARNING: Cannot open file /home/user/java/Oracle/Middleware/jdeveloper/jdev/extensions/oracle.ideimpl.feedback2.client.jar
Sep 13, 2011 3:33:50 PM org.apidesign.netbinox.JarBundleFile$1 checkedOpen
WARNING: Cannot open file /home/user/java/Oracle/Middleware/modules/com.oracle.ws.http_client_1.3.0.0.jar
Migration failed for the following file(s):
/home/user/Desktop/workflow-104-ContractApproval/workflow-104-ContractApproval/ContractApprovalApp/ContractApprovalApp.jws
[3:34:14 PM] Migration finished.

Comments