Android Studio不会在OpenSUSE上启动(打开的文件太多)

我有一段时间没有发布在StackOverflow上,所以请原谅,如果我把这个错误的地方,但这里的问题:

我最近下载了Android Studio,用于我刚安装的OpenSUSE系统,已经安装了openjdk-devel,每当我尝试启动studio.sh时,启animation面就会出现,通过加载使其大约70%的路程,然后Spam控制台有:

[ 7146] ERROR - j.util.io.ResizeableMappedFile - /home/user/.AndroidStudio1.3/system/caches/names.dat.len (Too many open files) java.io.FileNotFoundException: /home/user/.AndroidStudio1.3/system/caches/names.dat.len (Too many open files) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.<init>(FileOutputStream.java:221) at java.io.FileOutputStream.<init>(FileOutputStream.java:171) at com.intellij.util.io.ResizeableMappedFile$1.execute(ResizeableMappedFile.java:119) at com.intellij.util.io.ResizeableMappedFile$1.execute(ResizeableMappedFile.java:114) at com.intellij.openapi.util.io.FileUtilRt.doIOOperation(FileUtilRt.java:700) at com.intellij.util.io.ResizeableMappedFile.writeLength(ResizeableMappedFile.java:114) at com.intellij.util.io.ResizeableMappedFile.readLength(ResizeableMappedFile.java:164) at com.intellij.util.io.ResizeableMappedFile.<init>(ResizeableMappedFile.java:55) at com.intellij.util.io.PersistentBTreeEnumerator.<init>(PersistentBTreeEnumerator.java:82) at com.intellij.util.io.PersistentEnumeratorDelegate.<init>(PersistentEnumeratorDelegate.java:38) at com.intellij.util.io.PersistentStringEnumerator.<init>(PersistentStringEnumerator.java:53) at com.intellij.util.io.PersistentStringEnumerator.<init>(PersistentStringEnumerator.java:46) at com.intellij.util.io.PersistentStringEnumerator.<init>(PersistentStringEnumerator.java:32) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:244) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.init(FSRecords.java:319) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords$DbConnection.connect(FSRecords.java:160) at com.intellij.openapi.vfs.newvfs.persistent.FSRecords.connect(FSRecords.java:518) at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.initComponent(PersistentFSImpl.java:89) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:568) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) at org.picocontainer.defaults.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:77) at org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:114) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:257) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:217) at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248) at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:58) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:550) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) at org.picocontainer.defaults.CollectionComponentParameter.getArrayInstance(CollectionComponentParameter.java:268) at org.picocontainer.defaults.CollectionComponentParameter.resolveInstance(CollectionComponentParameter.java:127) at org.picocontainer.defaults.ComponentParameter.resolveInstance(ComponentParameter.java:116) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getConstructorArguments(ConstructorInjectionComponentAdapter.java:257) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:217) at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53) at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248) at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:58) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:550) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponentFromContainer(ComponentManagerImpl.java:168) at com.intellij.openapi.application.impl.ApplicationImpl.getComponentFromContainer(ApplicationImpl.java:533) at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:199) at com.intellij.openapi.components.impl.ComponentManagerImpl.getComponent(ComponentManagerImpl.java:194) at com.intellij.openapi.vfs.VirtualFileManager.getInstance(VirtualFileManager.java:44) at com.intellij.openapi.vfs.LocalFileSystem$LocalFileSystemHolder.<clinit>(LocalFileSystem.java:40) at com.intellij.openapi.vfs.LocalFileSystem.getInstance(LocalFileSystem.java:44) at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl$1.beforeFileBasedStorageCreate(ApplicationStoreImpl.java:85) at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl.createFileStateStorage(StateStorageManagerImpl.java:212) at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl.createStateStorage(StateStorageManagerImpl.java:185) at com.intellij.openapi.components.impl.stores.StateStorageManagerImpl.getStateStorage(StateStorageManagerImpl.java:102) at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.initPersistentComponent(ComponentStoreImpl.java:315) at com.intellij.openapi.components.impl.stores.ComponentStoreImpl.initComponent(ComponentStoreImpl.java:75) at com.intellij.openapi.application.impl.ApplicationImpl.initializeComponent(ApplicationImpl.java:177) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter$1.getComponentInstance(ComponentManagerImpl.java:566) at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:610) at com.intellij.util.pico.DefaultPicoContainer.getLocalInstance(DefaultPicoContainer.java:245) at com.intellij.util.pico.DefaultPicoContainer.getComponentInstance(DefaultPicoContainer.java:211) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponent(ComponentManagerImpl.java:125) at com.intellij.openapi.application.impl.ApplicationImpl.createComponent(ApplicationImpl.java:354) at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:116) at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:87) at com.intellij.openapi.components.impl.stores.ApplicationStoreImpl.load(ApplicationStoreImpl.java:101) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:499) at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:481) at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:170) at com.intellij.idea.MainImpl$1$1$1.run(MainImpl.java:52) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745) at java.awt.EventQueue.access$300(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:706) at java.awt.EventQueue$3.run(EventQueue.java:704) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:715) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:362) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91) [ 7150] ERROR - j.util.io.ResizeableMappedFile - Android Studio 1.3.1 Build #AI-141.2135290 [ 7151] ERROR - j.util.io.ResizeableMappedFile - JDK: 1.7.0_85 [ 7151] ERROR - j.util.io.ResizeableMappedFile - VM: OpenJDK Server VM [ 7151] ERROR - j.util.io.ResizeableMappedFile - Vendor: Oracle Corporation [ 7151] ERROR - j.util.io.ResizeableMappedFile - OS: Linux 

我的智慧就这样结束了。 我已经尝试链接到openjdk以及Oracle最新的JDK版本。 我试过玩最大打开文件的数量(在/etc/environment/limits.conf中设置),但是这似乎没有做任何事情,尽pipe错误表明有大量的打开文件。 我已经尝试升级到openjdk1.8,降级到1.7,重新安装所有的东西,但我似乎无法启动的事情。

这是一个合法的错误或重要的用户错误? 关于我在哪里可以find的任何想法可能解决这个问题?

编辑:/etc/environment/limits.conf

 # /etc/security/limits.conf # #Each line describes a limit for a user in the form: # #<domain> <type> <item> <value> # #Where: #<domain> can be: # - a user name # - a group name, with @group syntax # - the wildcard *, for default entry # - the wildcard %, can be also used with %group syntax, # for maxlogin limit # #<type> can have the two values: # - "soft" for enforcing the soft limits # - "hard" for enforcing hard limits # #<item> can be one of the following: # - core - limits the core file size (KB) # - data - max data size (KB) # - fsize - maximum filesize (KB) # - memlock - max locked-in-memory address space (KB) # - nofile - max number of open files # - rss - max resident set size (KB) # - stack - max stack size (KB) # - cpu - max CPU time (MIN) # - nproc - max number of processes # - as - address space limit (KB) # - maxlogins - max number of logins for this user # - maxsyslogins - max number of logins on the system # - priority - the priority to run user process with # - locks - max number of file locks the user can hold # - sigpending - max number of pending signals # - msgqueue - max memory used by POSIX message queues (bytes) # - nice - max nice priority allowed to raise to values: [-20, 19] # - rtprio - max realtime priority # #<domain> <type> <item> <value> # #* soft core 0 #* hard rss 10000 #@student hard nproc 20 #@faculty soft nproc 20 #@faculty hard nproc 50 #ftp hard nproc 0 #@student - maxlogins 4 * hard nofile 65535 * soft nofile 65535 root soft nofile 65535 root hard nofile 65535 # End of file 

uname -a

 Linux susebart 3.16.7-21-desktop #1 SMP PREEMPT Tue Apr 14 07:11:37 UTC 2015 (93c1539) i686 i686 i386 GNU/Linux 

猫/ proc /版本

 Linux version 3.16.7-21-desktop (geeko@buildhost) (gcc version 4.8.3 20140627 [gcc-4_8-branch revision 212064] (SUSE Linux) ) #1 SMP PREEMPT Tue Apr 14 07:11:37 UTC 2015 (93c1539) 

这里有一些神秘的shell输出:

 $ whoami corey $ ulimit -Hn 256 $ ulimit -Sn 256 $ su $ whoami root $ ulimit -Hn 65535 $ ulimit -Sn 65535 $ su corey $ whoami corey $ ulimit -Hn 65535 $ ulimit -Sn 65535 $ exit $ exit // getting back to login shell $ whoami corey $ ulimit -Hn 256 $ ulimit -Sn 256 

因此,当打开一个新的shell时(即使没有在上面的嵌套su的情况下先切换到root的话),但是当机器启动或者新的shell被打开的时候,限制看起来是正确的。 我确认通过运行su USERNAME ./studio.sh我能够最后启动程序,所以至less存在一个解决方法。 任何线索怎么回事与shell实例?

至于现在这是怎么回事:

 $ whoami //session 1 (256) corey $ ulimit -Hn 256 $ ulimit -Sn 256 $ su //session 2 (65k) $ whoami root $ ulimit -Hn 65535 $ ulimit -Sn 65535 $ su corey //session 3 (65k) $ whoami corey $ ulimit -Hn 65535 $ ulimit -Sn 65535 $ exit //session 2(65k) $ exit // getting back to login shell: session 1 (256) $ whoami corey $ ulimit -Hn 256 $ ulimit -Sn 256 

su命令使得有可能通过登录到系统来更改登录会话的所有者(即最初创建该会话的用户), 所有者不必首先从该会话中注销。 所以,当你注销两次(从根和会话的会话)你回到你的旧限制似乎工作的初始会议。 我不知道如果你正确地重新启动系统会怎么样,所以我只是建议你在corey重新登录 (意味着明确注销和登录),我敢打赌, limits.conf新值最终会被应用。