fork 콜 실패 문제입니다.

gazam의 이미지

안녕하세요.

요즘 회사에서 판매중인 제품의 칩 SDK가

업데이트 되면서 리눅스 커널도 2.6.37로 업데이트작업을

하고 있습니다. 업데이트 후 이상 증상이 보이는데

궁금한게 있어서 이렇게 질문 드립니다.

이전 버젼에서 커널 부팅 시 파라미터에 bigphysarea=5000을 주고 사용중이었습니다.

원래는 기본값이 2000인데 어떤 문제때문에 5000으로 바꼈다고 하더라구요.

그래서 커널과 SDK를 업데이트 하면서 어플리케이션 실행 시 fork 함수와

system() 함수(c언어 라이브러리에 있는) 호출이 안되더군요.

perror 로 찍어보면 cannot allocate memory 라고 나옵니다.

bigphysarea=2000으로 바꾸면 잘 되구요. 5000으로 할 때 메모리가 모자르거나 하지는 않습니다.

이 bigphysarea의 역할을 찾아보니 드라이버단에서 쓸 수 있는 메모리? 정도로 이해했는데요.

가용 메모리가 충분한 상황인데 왜 이 bigphysarea의 값에 따라 fork 나 system 함수에 호출에

문제가 생기는지 궁금합니다. 혹시 힌트 될 만한 것이라도 있으면 가르쳐주십시오.

감사합니다.

익명 사용자의 이미지

system() 혹은 fork()를 호출하는 프로세스가 메모리를 많이 사용하는 듯 하네요.

COW 방식이라고는 하나, 해당 명령 호출시 적어도 프로세스만큼의 가용 메모리가 시스템에 있어야할 수도 있습니다.

bigphysarea 제외한 가용메모리가 충분한 것 같아도, 실제로 충분하지 않을 수도 있다는 이야기입니다. 그러니 bigphysarea 값이 줄어들면 결과가 다른거구요. kernel 버전에 따라 memory management 방식이 조금씩 다를 수도 있구요.

system(), fork()를 별도의 외부 프로세스에서 호출하도록 한다거나 (main 프로세스와는 IPC로 별도 통신), 가능하면 system(), fork()를 사용 안 하는게 좋겠죠.

http://developers.sun.com/solaris/articles/subprocess/subprocess.html

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.