Skip to Main Content

Application Development Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Python script erroring out with message IndentationError: expected an indented block

Anindya GMar 6 2019 — edited Mar 12 2019

Hi,

I am creating a code in python to check the Garbage collection but its erroring out with the below error message as. Can anyone please help me out.

File "/u01/app/oracle/Middleware/user_projects/domains/base_domain/GC_check.py", line 11

    free = int(server.getJVMRuntime().getHeapFreeCurrent())/(1024*1024)

       ^

IndentationError: expected an indented block

#!/usr/bin/env python

import shutil

import os

wlsUserID = java.lang.System.getenv('wlsUserID')

wlsPassword = java.lang.System.getenv('wlsPassword')

connect(  url='t3://localhost:7010', adminServerName='AdminServer')

domainRuntime()

servers=domainRuntimeService.getServerRuntimes();

printf('#Java heap information for ')

for server in servers:

free = int(server.getJVMRuntime().getHeapFreeCurrent())/(1024*1024)

freePct = int(server.getJVMRuntime().getHeapFreePercent())

current = int(server.getJVMRuntime().getHeapSizeCurrent())/(1024*1024)

max = int(server.getJVMRuntime().getHeapSizeMax())/(1024*1024)

disconnect()

exit()

Thanks,

Anindya.

Comments

Daniel Merchán

Hi,


Please copy the content of your fragment file here.

Kind regards.

vinaykumar2

problem in the content of jsff file. Paste content of that file.

1 - 2

Post Details

Added on Mar 6 2019
3 comments
660 views